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
-
-
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 void
destroy()
Called to release any allocated resourcesvoid
init(ClientSession session, java.lang.String service)
boolean
process(Buffer buffer)
default void
signalAuthMethodFailure(ClientSession session, java.lang.String service, boolean partial, java.util.List<java.lang.String> serverMethods, Buffer buffer)
Signals reception ofSSH_MSG_USERAUTH_FAILURE
messagedefault void
signalAuthMethodSuccess(ClientSession session, java.lang.String service, Buffer buffer)
Signal reception ofSSH_MSG_USERAUTH_SUCCESS
message-
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, java.lang.String service) throws java.lang.Exception
- Parameters:
session
- TheClientSession
service
- The requesting service name- Throws:
java.lang.Exception
- If failed to initialize the mechanism
-
process
boolean process(Buffer buffer) throws java.lang.Exception
- Parameters:
buffer
- TheBuffer
to process -null
if not a response buffer, i.e., the underlying authentication mechanism should initiate whatever challenge/response mechanism is required- Returns:
true
if request handled -false
if the next authentication mechanism should be used- Throws:
java.lang.Exception
- If failed to process the request
-
signalAuthMethodSuccess
default void signalAuthMethodSuccess(ClientSession session, java.lang.String service, Buffer buffer) throws java.lang.Exception
Signal reception ofSSH_MSG_USERAUTH_SUCCESS
message- Parameters:
session
- TheClientSession
service
- The requesting service namebuffer
- TheBuffer
containing the success message (after having consumed the relevant data from it)- Throws:
java.lang.Exception
- If failed to handle the callback - Note: may cause session close
-
signalAuthMethodFailure
default void signalAuthMethodFailure(ClientSession session, java.lang.String service, boolean partial, java.util.List<java.lang.String> serverMethods, Buffer buffer) throws java.lang.Exception
Signals reception ofSSH_MSG_USERAUTH_FAILURE
message- Parameters:
session
- TheClientSession
service
- The requesting service namepartial
-true
if some partial authentication success so farserverMethods
- TheList
of authentication methods that can continuebuffer
- TheBuffer
containing the failure message (after having consumed the relevant data from it)- Throws:
java.lang.Exception
- If failed to handle the callback - Note: may cause session close
-
destroy
void destroy()
Called to release any allocated resources
-
-