Package com.sshtools.common.auth
Class KeyboardInteractiveAuthentication<C extends Context>
java.lang.Object
com.sshtools.common.auth.KeyboardInteractiveAuthentication<C>
- All Implemented Interfaces:
AuthenticationMechanism
public class KeyboardInteractiveAuthentication<C extends Context>
extends Object
implements AuthenticationMechanism
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionKeyboardInteractiveAuthentication(AbstractServerTransport<C> transport, AbstractAuthenticationProtocol<C> authentication, SshConnection con, KeyboardInteractiveAuthenticationProvider[] providers) -
Method Summary
Modifier and TypeMethodDescriptionReturn the SSH method name for this authentication.booleanprocessMessage(byte[] msg) If the SSH protocol authentication method defines additional messages which are sent from the client, they will be passed into your implementation here when received.booleanstartRequest(String username, byte[] msg) Start an authentication transaction.
-
Field Details
-
SSH_MSG_USERAUTH_INFO_REQUEST
public static final int SSH_MSG_USERAUTH_INFO_REQUEST- See Also:
-
SSH_MSG_USERAUTH_INFO_RESPONSE
public static final int SSH_MSG_USERAUTH_INFO_RESPONSE- See Also:
-
AUTHENTICATION_METHOD
- See Also:
-
-
Constructor Details
-
KeyboardInteractiveAuthentication
public KeyboardInteractiveAuthentication(AbstractServerTransport<C> transport, AbstractAuthenticationProtocol<C> authentication, SshConnection con, KeyboardInteractiveAuthenticationProvider[] providers)
-
-
Method Details
-
getMethod
Description copied from interface:AuthenticationMechanismReturn the SSH method name for this authentication. e.g "password"- Specified by:
getMethodin interfaceAuthenticationMechanism- Returns:
- String
-
processMessage
Description copied from interface:AuthenticationMechanismIf the SSH protocol authentication method defines additional messages which are sent from the client, they will be passed into your implementation here when received.- Specified by:
processMessagein interfaceAuthenticationMechanism- Returns:
- boolean
- Throws:
IOException
-
startRequest
Description copied from interface:AuthenticationMechanismStart an authentication transaction. If the authentication mechanism is simple and you can determine the result from all information received in the SSH_MSG_USERAUTH_REQUEST message, you should call the approriate completion methods on thecom.maverick.sshd.AuthenticationProtocolinstance that was passed in the initialization process. The request data varies according to the authentication method.if (success) authentication.completedAuthentication(method, username, service); else authentication.failedAuthentication(method);- Specified by:
startRequestin interfaceAuthenticationMechanismmsg- the request data from the SSH_MSG_USERAUTH_REQUEST message- Returns:
- true if the message was processed, otherwise false
- Throws:
IOException
-
getSelectedProvider
-