public class UserAuthPassword extends AbstractUserAuth
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
current |
static java.lang.String |
NAME |
private java.util.Iterator<java.lang.String> |
passwords |
log
BY_NAME_COMPARATOR, NAME_EXTRACTOR
Constructor and Description |
---|
UserAuthPassword() |
Modifier and Type | Method and Description |
---|---|
void |
init(ClientSession session,
java.lang.String service) |
protected boolean |
processAuthDataRequest(ClientSession session,
java.lang.String service,
Buffer buffer) |
protected boolean |
sendAuthDataRequest(ClientSession session,
java.lang.String service) |
protected IoWriteFuture |
sendPassword(Buffer buffer,
ClientSession session,
java.lang.String oldPassword,
java.lang.String newPassword)
Sends the password via a
SSH_MSG_USERAUTH_REQUEST message. |
destroy, getClientSession, getName, getService, getSession, process, toString
getSimplifiedLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
findByName, getNameList, getNames, ofName, removeByName
public static final java.lang.String NAME
private java.util.Iterator<java.lang.String> passwords
private java.lang.String current
public void init(ClientSession session, java.lang.String service) throws java.lang.Exception
init
in interface UserAuth
init
in class AbstractUserAuth
session
- The ClientSession
service
- The requesting service namejava.lang.Exception
- If failed to initialize the mechanismprotected boolean sendAuthDataRequest(ClientSession session, java.lang.String service) throws java.lang.Exception
sendAuthDataRequest
in class AbstractUserAuth
java.lang.Exception
protected boolean processAuthDataRequest(ClientSession session, java.lang.String service, Buffer buffer) throws java.lang.Exception
processAuthDataRequest
in class AbstractUserAuth
java.lang.Exception
protected IoWriteFuture sendPassword(Buffer buffer, ClientSession session, java.lang.String oldPassword, java.lang.String newPassword) throws java.io.IOException
SSH_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).buffer
- The Buffer
to re-use for sending the messagesession
- The target ClientSession
oldPassword
- The previous passwordnewPassword
- The new passwordIoWriteFuture
that can be used to wait and check on the success/failure of the
request packet being sentjava.io.IOException
- If failed to send the message.