Interface UserAuth

All Superinterfaces:
ClientSessionHolder, org.apache.sshd.common.NamedResource, org.apache.sshd.common.auth.UserAuthInstance<ClientSession>
All Known Implementing Classes:
AbstractUserAuth, UserAuthHostBased, UserAuthKeyboardInteractive, UserAuthPassword, UserAuthPublicKey

public interface UserAuth extends ClientSessionHolder, org.apache.sshd.common.auth.UserAuthInstance<ClientSession>
Represents a user authentication mechanism
Author:
Apache MINA SSHD Project
  • Field Summary

    Fields inherited from interface org.apache.sshd.common.NamedResource

    BY_NAME_COMPARATOR, NAME_EXTRACTOR
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called to release any allocated resources
    void
    init(ClientSession session, String service)
     
    default boolean
    Tells whether the authentication protocol is cancellable currently.
    boolean
    process(org.apache.sshd.common.util.buffer.Buffer buffer)
     
    default void
    signalAuthMethodFailure(ClientSession session, String service, boolean partial, List<String> serverMethods, org.apache.sshd.common.util.buffer.Buffer buffer)
    Signals reception of SSH_MSG_USERAUTH_FAILURE message
    default void
    signalAuthMethodSuccess(ClientSession session, String service, org.apache.sshd.common.util.buffer.Buffer buffer)
    Signal reception of SSH_MSG_USERAUTH_SUCCESS message

    Methods inherited from interface ClientSessionHolder

    getClientSession

    Methods inherited from interface org.apache.sshd.common.NamedResource

    getName

    Methods inherited from interface org.apache.sshd.common.auth.UserAuthInstance

    getSession
  • Method Details

    • init

      void init(ClientSession session, String service) throws Exception
      Parameters:
      session - The ClientSession
      service - The requesting service name
      Throws:
      Exception - If failed to initialize the mechanism
    • process

      boolean process(org.apache.sshd.common.util.buffer.Buffer buffer) throws Exception
      Parameters:
      buffer - The Buffer to process - null if not a response buffer, i.e., the underlying authentication mechanism should initiate whatever challenge/response mechanism is required
      Returns:
      true if request handled - false if the next authentication mechanism should be used
      Throws:
      Exception - If failed to process the request
    • signalAuthMethodSuccess

      default void signalAuthMethodSuccess(ClientSession session, String service, org.apache.sshd.common.util.buffer.Buffer buffer) throws Exception
      Signal reception of SSH_MSG_USERAUTH_SUCCESS message
      Parameters:
      session - The ClientSession
      service - The requesting service name
      buffer - The Buffer containing the success message (after having consumed the relevant data from it)
      Throws:
      Exception - If failed to handle the callback - Note: may cause session close
    • signalAuthMethodFailure

      default void signalAuthMethodFailure(ClientSession session, String service, boolean partial, List<String> serverMethods, org.apache.sshd.common.util.buffer.Buffer buffer) throws Exception
      Signals reception of SSH_MSG_USERAUTH_FAILURE message
      Parameters:
      session - The ClientSession
      service - The requesting service name
      partial - true if some partial authentication success so far
      serverMethods - The List of authentication methods that can continue
      buffer - The Buffer containing the failure message (after having consumed the relevant data from it)
      Throws:
      Exception - If failed to handle the callback - Note: may cause session close
    • isCancellable

      default boolean isCancellable()
      Tells whether the authentication protocol is cancellable currently.
      Returns:
      true if the protocol can be canceled at its current state; false if not.
    • destroy

      void destroy()
      Called to release any allocated resources