Class UserAuthHostBased

java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.client.auth.AbstractUserAuth
org.apache.sshd.client.auth.hostbased.UserAuthHostBased
All Implemented Interfaces:
UserAuth, ClientSessionHolder, org.apache.sshd.common.auth.UserAuthInstance<ClientSession>, org.apache.sshd.common.NamedResource, org.apache.sshd.common.signature.SignatureFactoriesHolder, org.apache.sshd.common.signature.SignatureFactoriesManager

public class UserAuthHostBased extends AbstractUserAuth implements org.apache.sshd.common.signature.SignatureFactoriesManager
Author:
Apache MINA SSHD Project
  • Field Details

  • Constructor Details

    • UserAuthHostBased

      public UserAuthHostBased(org.apache.sshd.client.auth.hostbased.HostKeyIdentityProvider clientHostKeys)
  • Method Details

    • init

      public void init(ClientSession session, String service) throws Exception
      Specified by:
      init in interface UserAuth
      Overrides:
      init in class AbstractUserAuth
      Parameters:
      session - The ClientSession
      service - The requesting service name
      Throws:
      Exception - If failed to initialize the mechanism
    • getSignatureFactories

      public List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.signature.Signature>> getSignatureFactories()
      Specified by:
      getSignatureFactories in interface org.apache.sshd.common.signature.SignatureFactoriesHolder
    • setSignatureFactories

      public void setSignatureFactories(List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.signature.Signature>> factories)
      Specified by:
      setSignatureFactories in interface org.apache.sshd.common.signature.SignatureFactoriesManager
    • getClientUsername

      public String getClientUsername()
    • setClientUsername

      public void setClientUsername(String clientUsername)
    • getClientHostname

      public String getClientHostname()
    • setClientHostname

      public void setClientHostname(String clientHostname)
    • sendAuthDataRequest

      protected boolean sendAuthDataRequest(ClientSession session, String service) throws Exception
      Specified by:
      sendAuthDataRequest in class AbstractUserAuth
      Throws:
      Exception
    • appendSignature

      protected byte[] appendSignature(ClientSession session, String service, String keyType, PublicKey key, byte[] keyBytes, String clientHostname, String clientUsername, org.apache.sshd.common.signature.Signature verifier, org.apache.sshd.common.util.buffer.Buffer buffer) throws Exception
      Throws:
      Exception
    • processAuthDataRequest

      protected boolean processAuthDataRequest(ClientSession session, String service, org.apache.sshd.common.util.buffer.Buffer buffer) throws Exception
      Specified by:
      processAuthDataRequest in class AbstractUserAuth
      Throws:
      Exception
    • signalAuthMethodSuccess

      public void signalAuthMethodSuccess(ClientSession session, String service, org.apache.sshd.common.util.buffer.Buffer buffer) throws Exception
      Description copied from interface: UserAuth
      Signal reception of SSH_MSG_USERAUTH_SUCCESS message
      Specified by:
      signalAuthMethodSuccess in interface UserAuth
      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

      public void signalAuthMethodFailure(ClientSession session, String service, boolean partial, List<String> serverMethods, org.apache.sshd.common.util.buffer.Buffer buffer) throws Exception
      Description copied from interface: UserAuth
      Signals reception of SSH_MSG_USERAUTH_FAILURE message
      Specified by:
      signalAuthMethodFailure in interface UserAuth
      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
    • resolveClientUsername

      protected String resolveClientUsername(ClientSession session)
    • resolveClientHostname

      protected String resolveClientHostname(ClientSession session)