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,UserAuthInstance<ClientSession>,NamedResource,SignatureFactoriesHolder,SignatureFactoriesManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final HostKeyIdentityProviderprivate Stringprivate Stringprivate List<NamedFactory<Signature>> protected Map.Entry<KeyPair, ? extends Collection<X509Certificate>> protected Iterator<? extends Map.Entry<KeyPair, ? extends Collection<X509Certificate>>> static final StringFields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
logFields inherited from interface org.apache.sshd.common.NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]appendSignature(ClientSession session, String service, String keyType, PublicKey key, byte[] keyBytes, String clientHostname, String clientUsername, Signature verifier, Buffer buffer) voidinit(ClientSession session, String service) protected booleanprocessAuthDataRequest(ClientSession session, String service, Buffer buffer) protected StringresolveClientHostname(ClientSession session) protected StringresolveClientUsername(ClientSession session) protected booleansendAuthDataRequest(ClientSession session, String service) voidsetClientHostname(String clientHostname) voidsetClientUsername(String clientUsername) voidsetSignatureFactories(List<NamedFactory<Signature>> factories) voidsignalAuthMethodFailure(ClientSession session, String service, boolean partial, List<String> serverMethods, Buffer buffer) Signals reception ofSSH_MSG_USERAUTH_FAILUREmessagevoidsignalAuthMethodSuccess(ClientSession session, String service, Buffer buffer) Signal reception ofSSH_MSG_USERAUTH_SUCCESSmessageMethods inherited from class org.apache.sshd.client.auth.AbstractUserAuth
destroy, getClientSession, getName, getService, getSession, isCancellable, process, setCancellable, toStringMethods 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, warnMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.sshd.common.signature.SignatureFactoriesHolder
getSignatureFactoriesNameList, getSignatureFactoriesNamesMethods inherited from interface org.apache.sshd.common.signature.SignatureFactoriesManager
setSignatureFactoriesNameList, setSignatureFactoriesNames, setSignatureFactoriesNames
-
Field Details
-
NAME
- See Also:
-
keys
-
keyInfo
-
clientHostKeys
-
factories
-
clientUsername
-
clientHostname
-
-
Constructor Details
-
UserAuthHostBased
-
-
Method Details
-
init
- Specified by:
initin interfaceUserAuth- Overrides:
initin classAbstractUserAuth- Parameters:
session- TheClientSessionservice- The requesting service name- Throws:
Exception- If failed to initialize the mechanism
-
getSignatureFactories
- Specified by:
getSignatureFactoriesin interfaceSignatureFactoriesHolder- Returns:
- The list of named
Signaturefactories
-
setSignatureFactories
- Specified by:
setSignatureFactoriesin interfaceSignatureFactoriesManager
-
getClientUsername
-
setClientUsername
-
getClientHostname
-
setClientHostname
-
sendAuthDataRequest
- Specified by:
sendAuthDataRequestin classAbstractUserAuth- Throws:
Exception
-
appendSignature
protected byte[] appendSignature(ClientSession session, String service, String keyType, PublicKey key, byte[] keyBytes, String clientHostname, String clientUsername, Signature verifier, Buffer buffer) throws Exception - Throws:
Exception
-
processAuthDataRequest
protected boolean processAuthDataRequest(ClientSession session, String service, Buffer buffer) throws Exception - Specified by:
processAuthDataRequestin classAbstractUserAuth- Throws:
Exception
-
signalAuthMethodSuccess
public void signalAuthMethodSuccess(ClientSession session, String service, Buffer buffer) throws Exception Description copied from interface:UserAuthSignal reception ofSSH_MSG_USERAUTH_SUCCESSmessage- Specified by:
signalAuthMethodSuccessin interfaceUserAuth- Parameters:
session- TheClientSessionservice- The requesting service namebuffer- TheBuffercontaining 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, Buffer buffer) throws Exception Description copied from interface:UserAuthSignals reception ofSSH_MSG_USERAUTH_FAILUREmessage- Specified by:
signalAuthMethodFailurein interfaceUserAuth- Parameters:
session- TheClientSessionservice- The requesting service namepartial-trueif some partial authentication success so farserverMethods- TheListof authentication methods that can continuebuffer- TheBuffercontaining 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
-
resolveClientHostname
-