Top Description Methods
org.apache.sshd.client.auth

public Interface UserAuth

extends ClientSessionHolder, UserAuthInstance<ClientSession>
Known Direct Implementers
org.apache.sshd.client.auth.AbstractUserAuth
Imports
java.util.List, org.apache.sshd.client.session.ClientSession, .ClientSessionHolder, org.apache.sshd.common.auth.UserAuthInstance, org.apache.sshd.common.util.buffer.Buffer

Represents a user authentication mechanism
Author
Apache MINA SSHD Project

Method Summary

Modifier and TypeMethod and Description
public void
destroy()

Called to release any allocated resources

public void
init(ClientSession session, String
The requesting service name
service
)

public default boolean

Returns:

true if the protocol can be canceled at its current state; false if not.
isCancellable
()

Tells whether the authentication protocol is cancellable currently.

public boolean

Returns:

true if request handled - false if the next authentication mechanism should be used
process
(Buffer
The Buffer to process - null if not a response buffer, i.e., the underlying authentication mechanism should initiate whatever challenge/response mechanism is required
buffer
)

public default 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
)

Signals reception of SSH_MSG_USERAUTH_FAILURE message

public default 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
)

Signal reception of SSH_MSG_USERAUTH_SUCCESS message

Inherited from org.apache.sshd.client.session.ClientSessionHolder:
getClientSession
Inherited from org.apache.sshd.common.auth.UserAuthInstance:
getSession

Method Detail

destroyback to summary
public void destroy()

Called to release any allocated resources

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

The ClientSession

service:String

The requesting service name

Exceptions
Exception:
If failed to initialize the mechanism
isCancellableback to summary
public default boolean isCancellable()

Tells whether the authentication protocol is cancellable currently.

Returns:boolean

true if the protocol can be canceled at its current state; false if not.

processback to summary
public boolean process(Buffer buffer) throws Exception
Parameters
buffer:Buffer

The Buffer to process - null if not a response buffer, i.e., the underlying authentication mechanism should initiate whatever challenge/response mechanism is required

Returns:boolean

true if request handled - false if the next authentication mechanism should be used

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

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)

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

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)

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