Class UserAuthPassword
java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.client.auth.AbstractUserAuth
org.apache.sshd.client.auth.password.UserAuthPassword
- All Implemented Interfaces:
UserAuth, ClientSessionHolder, org.apache.sshd.common.auth.UserAuthInstance<ClientSession>, org.apache.sshd.common.NamedResource
Implements the client-side "password" authentication mechanism
- Author:
- Apache MINA SSHD Project
-
Field Summary
FieldsFields 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 TypeMethodDescriptionvoidinit(ClientSession session, String service) protected booleanprocessAuthDataRequest(ClientSession session, String service, org.apache.sshd.common.util.buffer.Buffer buffer) protected StringresolveAttemptedPassword(ClientSession session, String service) protected booleansendAuthDataRequest(ClientSession session, String service) protected org.apache.sshd.common.io.IoWriteFuturesendPassword(org.apache.sshd.common.util.buffer.Buffer buffer, ClientSession session, String oldPassword, String newPassword) Sends the password via aSSH_MSG_USERAUTH_REQUESTmessage.voidsignalAuthMethodFailure(ClientSession session, String service, boolean partial, List<String> serverMethods, org.apache.sshd.common.util.buffer.Buffer buffer) Signals reception ofSSH_MSG_USERAUTH_FAILUREmessagevoidsignalAuthMethodSuccess(ClientSession session, String service, org.apache.sshd.common.util.buffer.Buffer buffer) Signal reception ofSSH_MSG_USERAUTH_SUCCESSmessageMethods inherited from class 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, warn
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
UserAuthPassword
public UserAuthPassword()
-
-
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
-
sendAuthDataRequest
- Specified by:
sendAuthDataRequestin classAbstractUserAuth- Throws:
Exception
-
resolveAttemptedPassword
- Throws:
Exception
-
processAuthDataRequest
protected boolean processAuthDataRequest(ClientSession session, String service, org.apache.sshd.common.util.buffer.Buffer buffer) throws Exception - Specified by:
processAuthDataRequestin classAbstractUserAuth- Throws:
Exception
-
sendPassword
protected org.apache.sshd.common.io.IoWriteFuture sendPassword(org.apache.sshd.common.util.buffer.Buffer buffer, ClientSession session, String oldPassword, String newPassword) throws Exception Sends the password via aSSH_MSG_USERAUTH_REQUESTmessage. If old and new password are not the same then it requests a password modification from the server (which may be denied if the server does not support this feature).- Parameters:
buffer- TheBufferto re-use for sending the messagesession- The targetClientSessionoldPassword- The previous passwordnewPassword- The new password- Returns:
- An
IoWriteFuturethat can be used to wait and check on the success/failure of the request packet being sent - Throws:
Exception- If failed to send the message.
-
signalAuthMethodSuccess
public void signalAuthMethodSuccess(ClientSession session, String service, org.apache.sshd.common.util.buffer.Buffer buffer) throws Exception Description copied from interface:UserAuthSignal reception ofSSH_MSG_USERAUTH_SUCCESSmessage- 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, org.apache.sshd.common.util.buffer.Buffer buffer) throws Exception Description copied from interface:UserAuthSignals reception ofSSH_MSG_USERAUTH_FAILUREmessage- 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
-