public class UserAuthPassword extends AbstractUserAuth
Modifier and Type | Field and Description |
---|---|
static String |
NAME |
log
BY_NAME_COMPARATOR, NAME_EXTRACTOR
Constructor and Description |
---|
UserAuthPassword() |
Modifier and Type | Method and Description |
---|---|
void |
init(ClientSession session,
String service) |
protected boolean |
processAuthDataRequest(ClientSession session,
String service,
Buffer buffer) |
protected String |
resolveAttemptedPassword(ClientSession session,
String service) |
protected boolean |
sendAuthDataRequest(ClientSession session,
String service) |
protected IoWriteFuture |
sendPassword(Buffer buffer,
ClientSession session,
String oldPassword,
String newPassword)
Sends the password via a
SSH_MSG_USERAUTH_REQUEST message. |
void |
signalAuthMethodFailure(ClientSession session,
String service,
boolean partial,
List<String> serverMethods,
Buffer buffer)
Signals reception of
SSH_MSG_USERAUTH_FAILURE message |
void |
signalAuthMethodSuccess(ClientSession session,
String service,
Buffer buffer)
Signal reception of
SSH_MSG_USERAUTH_SUCCESS message |
destroy, getClientSession, getName, getService, getSession, process, toString
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
findByName, findFirstMatchByName, getNameList, getNames, ofName, removeByName, safeCompareByName
public static final String NAME
public void init(ClientSession session, String service) throws Exception
init
in interface UserAuth
init
in class AbstractUserAuth
session
- The ClientSession
service
- The requesting service nameException
- If failed to initialize the mechanismprotected boolean sendAuthDataRequest(ClientSession session, String service) throws Exception
sendAuthDataRequest
in class AbstractUserAuth
Exception
protected String resolveAttemptedPassword(ClientSession session, String service) throws Exception
Exception
protected boolean processAuthDataRequest(ClientSession session, String service, Buffer buffer) throws Exception
processAuthDataRequest
in class AbstractUserAuth
Exception
protected IoWriteFuture sendPassword(Buffer buffer, ClientSession session, String oldPassword, String newPassword) throws Exception
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 sentException
- If failed to send the message.public void signalAuthMethodSuccess(ClientSession session, String service, Buffer buffer) throws Exception
UserAuth
SSH_MSG_USERAUTH_SUCCESS
messagesession
- The ClientSession
service
- The requesting service namebuffer
- The Buffer
containing the success message (after having consumed the relevant data from
it)Exception
- If failed to handle the callback - Note: may cause session closepublic void signalAuthMethodFailure(ClientSession session, String service, boolean partial, List<String> serverMethods, Buffer buffer) throws Exception
UserAuth
SSH_MSG_USERAUTH_FAILURE
messagesession
- The ClientSession
service
- The requesting service namepartial
- true
if some partial authentication success so farserverMethods
- The List
of authentication methods that can continuebuffer
- The Buffer
containing the failure message (after having consumed the relevant data
from it)Exception
- If failed to handle the callback - Note: may cause session closeCopyright © 2008–2024 The Apache Software Foundation. All rights reserved.