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
,UserAuthInstance<ClientSession>
,NamedResource
Implements the client-side "password" authentication mechanism
-
Field Summary
FieldsFields 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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
init
(ClientSession session, String service) protected boolean
processAuthDataRequest
(ClientSession session, String service, Buffer buffer) protected boolean
sendAuthDataRequest
(ClientSession session, String service) protected IoWriteFuture
sendPassword
(Buffer buffer, ClientSession session, String oldPassword, String newPassword) Sends the password via aSSH_MSG_USERAUTH_REQUEST
message.Methods inherited from class org.apache.sshd.client.auth.AbstractUserAuth
destroy, getClientSession, getName, getService, getSession, process, toString
-
Field Details
-
NAME
- See Also:
-
passwords
-
current
-
-
Constructor Details
-
UserAuthPassword
public UserAuthPassword()
-
-
Method Details
-
init
- Specified by:
init
in interfaceUserAuth
- Overrides:
init
in classAbstractUserAuth
- Parameters:
session
- TheClientSession
service
- The requesting service name- Throws:
Exception
- If failed to initialize the mechanism
-
sendAuthDataRequest
- Specified by:
sendAuthDataRequest
in classAbstractUserAuth
- Throws:
Exception
-
processAuthDataRequest
protected boolean processAuthDataRequest(ClientSession session, String service, Buffer buffer) throws Exception - Specified by:
processAuthDataRequest
in classAbstractUserAuth
- Throws:
Exception
-
sendPassword
protected IoWriteFuture sendPassword(Buffer buffer, ClientSession session, String oldPassword, String newPassword) throws IOException Sends the password via aSSH_MSG_USERAUTH_REQUEST
message. 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
- TheBuffer
to re-use for sending the messagesession
- The targetClientSession
oldPassword
- The previous passwordnewPassword
- The new password- Returns:
- An
IoWriteFuture
that can be used to wait and check on the success/failure of the request packet being sent - Throws:
IOException
- If failed to send the message.
-