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 Details

  • Constructor Details

  • Method Details

    • hasProviders

      public boolean hasProviders()
    • getMethod

      public String getMethod()
      Description copied from interface: AuthenticationMechanism
      Return the SSH method name for this authentication. e.g "password"
      Specified by:
      getMethod in interface AuthenticationMechanism
      Returns:
      String
    • startRequest

      public boolean startRequest(String username, byte[] msg) throws IOException
      Description copied from interface: AuthenticationMechanism
      Start 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 the com.maverick.sshd.AuthenticationProtocol instance 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:
      startRequest in interface AuthenticationMechanism
      msg - the request data from the SSH_MSG_USERAUTH_REQUEST message
      Returns:
      true if the message was processed, otherwise false
      Throws:
      IOException
    • processMessage

      public boolean processMessage(byte[] msg) throws IOException
      Description copied from interface: AuthenticationMechanism
      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.
      Specified by:
      processMessage in interface AuthenticationMechanism
      Returns:
      boolean
      Throws:
      IOException