Top Description Fields Constructors Methods
org.apache.sshd.client.auth.password

public Class UserAuthPassword

extends AbstractUserAuth
Class Inheritance
Imports
java.util.Iterator, .List, .Objects, org.apache.sshd.client.auth.AbstractUserAuth, org.apache.sshd.client.auth.keyboard.UserInteraction, org.apache.sshd.client.session.ClientSession, org.apache.sshd.common.RuntimeSshException, .SshConstants, org.apache.sshd.common.auth.UserAuthMethodFactory, org.apache.sshd.common.io.IoWriteFuture, org.apache.sshd.common.util.GenericUtils, org.apache.sshd.common.util.buffer.Buffer, org.apache.sshd.core.CoreModuleProperties

Implements the client-side "password" authentication mechanism
Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
private String
private int
public static final String
private int
private Iterator<String>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
protected boolean
protected String
protected boolean
protected IoWriteFuture

Returns:

An IoWriteFuture that can be used to wait and check on the success/failure of the request packet being sent
sendPassword
(Buffer
The Buffer to re-use for sending the message
buffer
,
ClientSession
The target ClientSession
session
,
String
The previous password
oldPassword
,
String
The new password
newPassword
)

Sends the password via a SSH_MSG_USERAUTH_REQUEST message.

public void
signalAuthMethodFailure(ClientSession session, String
The requesting service name
service
,
boolean
true if some partial authentication success so far
partial
,
List<String>
The List of authentication methods that can continue
serverMethods
,
Buffer
The Buffer containing the failure message (after having consumed the relevant data from it)
buffer
)

Overrides default org.apache.sshd.client.auth.UserAuth.signalAuthMethodFailure.

Signals reception of SSH_MSG_USERAUTH_FAILURE message

public void
signalAuthMethodSuccess(ClientSession session, String
The requesting service name
service
,
Buffer
The Buffer containing the success message (after having consumed the relevant data from it)
buffer
)

Overrides default org.apache.sshd.client.auth.UserAuth.signalAuthMethodSuccess.

Signal reception of SSH_MSG_USERAUTH_SUCCESS message

Inherited from org.apache.sshd.client.auth.AbstractUserAuth:
destroygetClientSessiongetNamegetServicegetSessionisCancellableprocesssetCancellabletoString

Field Detail

currentback to summary
private String current
maxAttemptsback to summary
private int maxAttempts
NAMEback to summary
public static final String NAME
nOfAttemptsback to summary
private int nOfAttempts
passwordsback to summary
private Iterator<String> passwords

Constructor Detail

UserAuthPasswordback to summary
public UserAuthPassword()

Method Detail

initback to summary
public void init(ClientSession session, String service) throws Exception

Overrides org.apache.sshd.client.auth.AbstractUserAuth.init.

Implements org.apache.sshd.client.auth.UserAuth.init.

Parameters
session:ClientSession

Doc from org.apache.sshd.client.auth.UserAuth.init.

The ClientSession

service:String

Doc from org.apache.sshd.client.auth.UserAuth.init.

The requesting service name

Annotations
@Override
Exceptions
Exception:

Doc from org.apache.sshd.client.auth.UserAuth.init.

If failed to initialize the mechanism

processAuthDataRequestback to summary
protected boolean processAuthDataRequest(ClientSession session, String service, Buffer buffer) throws Exception

Implements abstract org.apache.sshd.client.auth.AbstractUserAuth.processAuthDataRequest.

Annotations
@Override
resolveAttemptedPasswordback to summary
protected String resolveAttemptedPassword(ClientSession session, String service) throws Exception
sendAuthDataRequestback to summary
protected boolean sendAuthDataRequest(ClientSession session, String service) throws Exception

Implements abstract org.apache.sshd.client.auth.AbstractUserAuth.sendAuthDataRequest.

Annotations
@Override
sendPasswordback to summary
protected IoWriteFuture sendPassword(Buffer buffer, ClientSession session, String oldPassword, String newPassword) throws Exception

Sends the password via a 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).

Parameters
buffer:Buffer

The Buffer to re-use for sending the message

session:ClientSession

The target ClientSession

oldPassword:String

The previous password

newPassword:String

The new password

Returns:IoWriteFuture

An IoWriteFuture that can be used to wait and check on the success/failure of the request packet being sent

Exceptions
Exception:
If failed to send the message.
signalAuthMethodFailureback to summary
public void signalAuthMethodFailure(ClientSession session, String service, boolean partial, List<String> serverMethods, Buffer buffer) throws Exception

Overrides default org.apache.sshd.client.auth.UserAuth.signalAuthMethodFailure.

Doc from org.apache.sshd.client.auth.UserAuth.signalAuthMethodFailure.

Signals reception of SSH_MSG_USERAUTH_FAILURE message

Parameters
session:ClientSession

The ClientSession

service:String

The requesting service name

partial:boolean

true if some partial authentication success so far

serverMethods:List<String>

The List of authentication methods that can continue

buffer:Buffer

The Buffer containing the failure message (after having consumed the relevant data from it)

Annotations
@Override
Exceptions
Exception:
If failed to handle the callback - Note: may cause session close
signalAuthMethodSuccessback to summary
public void signalAuthMethodSuccess(ClientSession session, String service, Buffer buffer) throws Exception

Overrides default org.apache.sshd.client.auth.UserAuth.signalAuthMethodSuccess.

Doc from org.apache.sshd.client.auth.UserAuth.signalAuthMethodSuccess.

Signal reception of SSH_MSG_USERAUTH_SUCCESS message

Parameters
session:ClientSession

The ClientSession

service:String

The requesting service name

buffer:Buffer

The Buffer containing the success message (after having consumed the relevant data from it)

Annotations
@Override
Exceptions
Exception:
If failed to handle the callback - Note: may cause session close