Package com.sshtools.common.auth
Class PasswordAuthentication<C extends Context>
java.lang.Object
com.sshtools.common.auth.PasswordAuthentication<C>
- All Implemented Interfaces:
AuthenticationMechanism
public class PasswordAuthentication<C extends Context>
extends Object
implements AuthenticationMechanism
Provides an
AuthenticationMechanism that enables the standard SSH
password authentication.- Author:
- Lee David Painter
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstruct an instance.PasswordAuthentication(AbstractServerTransport<C> transport, AbstractAuthenticationProtocol<C> authentication, SshConnection con, PasswordAuthenticationProvider[] providers) -
Method Summary
Modifier and TypeMethodDescriptionReturn the SSH method name for this authentication.booleanbooleanprocessMessage(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
-
AUTHENTICATION_METHOD
- See Also:
-
-
Constructor Details
-
PasswordAuthentication
public PasswordAuthentication()Construct an instance. -
PasswordAuthentication
public PasswordAuthentication(AbstractServerTransport<C> transport, AbstractAuthenticationProtocol<C> authentication, SshConnection con, PasswordAuthenticationProvider[] providers)
-
-
Method Details
-
hasProviders
public boolean hasProviders() -
getMethod
Description copied from interface:AuthenticationMechanismReturn the SSH method name for this authentication. e.g "password"- Specified by:
getMethodin interfaceAuthenticationMechanism- Returns:
- String
-
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
-
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
-