Package org.apache.sshd.client.auth
Interface UserAuth
-
- All Superinterfaces:
ClientSessionHolder,NamedResource,UserAuthInstance<ClientSession>
- All Known Implementing Classes:
AbstractUserAuth,UserAuthHostBased,UserAuthKeyboardInteractive,UserAuthPassword,UserAuthPublicKey
public interface UserAuth extends ClientSessionHolder, UserAuthInstance<ClientSession>
Represents a user authentication mechanism- Author:
- Apache MINA SSHD Project
-
-
Field Summary
-
Fields inherited from interface org.apache.sshd.common.NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTOR
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voiddestroy()Called to release any allocated resourcesvoidinit(ClientSession session, String service)default booleanisCancellable()Tells whether the authentication protocol is cancellable currently.booleanprocess(Buffer buffer)default voidsignalAuthMethodFailure(ClientSession session, String service, boolean partial, List<String> serverMethods, Buffer buffer)Signals reception ofSSH_MSG_USERAUTH_FAILUREmessagedefault voidsignalAuthMethodSuccess(ClientSession session, String service, Buffer buffer)Signal reception ofSSH_MSG_USERAUTH_SUCCESSmessage-
Methods inherited from interface org.apache.sshd.client.session.ClientSessionHolder
getClientSession
-
Methods inherited from interface org.apache.sshd.common.NamedResource
getName
-
Methods inherited from interface org.apache.sshd.common.auth.UserAuthInstance
getSession
-
-
-
-
Method Detail
-
init
void init(ClientSession session, String service) throws Exception
- Parameters:
session- TheClientSessionservice- The requesting service name- Throws:
Exception- If failed to initialize the mechanism
-
process
boolean process(Buffer buffer) throws Exception
- Parameters:
buffer- TheBufferto process -nullif not a response buffer, i.e., the underlying authentication mechanism should initiate whatever challenge/response mechanism is required- Returns:
trueif request handled -falseif the next authentication mechanism should be used- Throws:
Exception- If failed to process the request
-
signalAuthMethodSuccess
default void signalAuthMethodSuccess(ClientSession session, String service, Buffer buffer) throws Exception
Signal reception ofSSH_MSG_USERAUTH_SUCCESSmessage- Parameters:
session- TheClientSessionservice- The requesting service namebuffer- TheBuffercontaining the success message (after having consumed the relevant data from it)- Throws:
Exception- If failed to handle the callback - Note: may cause session close
-
signalAuthMethodFailure
default void signalAuthMethodFailure(ClientSession session, String service, boolean partial, List<String> serverMethods, Buffer buffer) throws Exception
Signals reception ofSSH_MSG_USERAUTH_FAILUREmessage- Parameters:
session- TheClientSessionservice- The requesting service namepartial-trueif some partial authentication success so farserverMethods- TheListof authentication methods that can continuebuffer- TheBuffercontaining the failure message (after having consumed the relevant data from it)- Throws:
Exception- If failed to handle the callback - Note: may cause session close
-
isCancellable
default boolean isCancellable()
Tells whether the authentication protocol is cancellable currently.- Returns:
trueif the protocol can be canceled at its current state;falseif not.
-
destroy
void destroy()
Called to release any allocated resources
-
-