Class AbstractUserAuth

java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.server.auth.AbstractUserAuth
All Implemented Interfaces:
org.apache.sshd.common.auth.UserAuthInstance<ServerSession>, org.apache.sshd.common.auth.UsernameHolder, org.apache.sshd.common.NamedResource, UserAuth, ServerSessionHolder
Direct Known Subclasses:
UserAuthGSS, UserAuthHostBased, UserAuthKeyboardInteractive, UserAuthNone, UserAuthPassword, UserAuthPublicKey

public abstract class AbstractUserAuth extends org.apache.sshd.common.util.logging.AbstractLoggingBean implements UserAuth
Author:
Apache MINA SSHD Project
  • Field Summary

    Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean

    log

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

    BY_NAME_COMPARATOR, NAME_EXTRACTOR
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    auth(ServerSession session, String username, String service, org.apache.sshd.common.util.buffer.Buffer buffer)
    Try to authenticate the user.
    void
    Free any system resources used by the module.
    protected abstract Boolean
    doAuth(org.apache.sshd.common.util.buffer.Buffer buffer, boolean init)
     
    final String
     
     
     
     
     
    next(org.apache.sshd.common.util.buffer.Buffer buffer)
    Handle another step in the authentication process.
     

    Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean

    debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • AbstractUserAuth

      protected AbstractUserAuth(String name)
  • Method Details

    • getName

      public final String getName()
      Specified by:
      getName in interface org.apache.sshd.common.NamedResource
    • getUsername

      public String getUsername()
      Specified by:
      getUsername in interface org.apache.sshd.common.auth.UsernameHolder
    • getService

      public String getService()
    • getServerSession

      public ServerSession getServerSession()
      Specified by:
      getServerSession in interface ServerSessionHolder
      Returns:
      The underlying ServerSession used
    • getSession

      public ServerSession getSession()
      Specified by:
      getSession in interface org.apache.sshd.common.auth.UserAuthInstance<ServerSession>
    • auth

      public Boolean auth(ServerSession session, String username, String service, org.apache.sshd.common.util.buffer.Buffer buffer) throws Exception
      Description copied from interface: UserAuth
      Try to authenticate the user. This methods should return a non null value indicating if the authentication succeeded. If the authentication is still ongoing, a null value should be returned.
      Specified by:
      auth in interface UserAuth
      Parameters:
      session - the current ServerSession session
      username - the user trying to log in
      service - the requested service name
      buffer - the request buffer containing parameters specific to this request
      Returns:
      true if the authentication succeeded, false if the authentication failed and null if not finished yet
      Throws:
      Exception - if the authentication fails
    • next

      public Boolean next(org.apache.sshd.common.util.buffer.Buffer buffer) throws Exception
      Description copied from interface: UserAuth
      Handle another step in the authentication process.
      Specified by:
      next in interface UserAuth
      Parameters:
      buffer - the request buffer containing parameters specific to this request
      Returns:
      true if the authentication succeeded, false if the authentication failed and null if not finished yet
      Throws:
      Exception - if the authentication fails
    • destroy

      public void destroy()
      Description copied from interface: UserAuth
      Free any system resources used by the module.
      Specified by:
      destroy in interface UserAuth
    • doAuth

      protected abstract Boolean doAuth(org.apache.sshd.common.util.buffer.Buffer buffer, boolean init) throws Exception
      Throws:
      Exception
    • toString

      public String toString()
      Overrides:
      toString in class Object