Package org.apache.sshd.server.auth
Class AbstractUserAuth
java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.server.auth.AbstractUserAuth
- All Implemented Interfaces:
UserAuthInstance<ServerSession>
,UsernameHolder
,NamedResource
,UserAuth
,ServerSessionHolder
- Direct Known Subclasses:
UserAuthGSS
,UserAuthHostBased
,UserAuthKeyboardInteractive
,UserAuthNone
,UserAuthPassword
,UserAuthPublicKey
- Author:
- Apache MINA SSHD Project
-
Field Summary
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
Fields inherited from interface org.apache.sshd.common.NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTOR
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionauth
(ServerSession session, String username, String service, Buffer buffer) Try to authenticate the user.void
destroy()
Free any system resources used by the module.protected abstract Boolean
final String
getName()
Handle another step in the authentication process.toString()
-
Constructor Details
-
AbstractUserAuth
-
-
Method Details
-
getName
- Specified by:
getName
in interfaceNamedResource
-
getUsername
- Specified by:
getUsername
in interfaceUsernameHolder
-
getService
-
getServerSession
- Specified by:
getServerSession
in interfaceServerSessionHolder
- Returns:
- The underlying
ServerSession
used
-
getSession
- Specified by:
getSession
in interfaceUserAuthInstance<ServerSession>
-
auth
public Boolean auth(ServerSession session, String username, String service, Buffer buffer) throws Exception Description copied from interface:UserAuth
Try to authenticate the user. This methods should return a nonnull
value indicating if the authentication succeeded. If the authentication is still ongoing, anull
value should be returned.- Specified by:
auth
in interfaceUserAuth
- Parameters:
session
- the currentServerSession
sessionusername
- the user trying to log inservice
- the requested service namebuffer
- the request buffer containing parameters specific to this request- Returns:
true
if the authentication succeeded,false
if the authentication failed andnull
if not finished yet- Throws:
AsyncAuthException
- if the service is willing to perform an asynchronous authenticationException
- if the authentication fails
-
next
Description copied from interface:UserAuth
Handle another step in the authentication process.- Specified by:
next
in interfaceUserAuth
- Parameters:
buffer
- the request buffer containing parameters specific to this request- Returns:
true
if the authentication succeeded,false
if the authentication failed andnull
if not finished yet- Throws:
AsyncAuthException
- if the service is willing to perform an asynchronous authenticationException
- if the authentication fails
-
destroy
public void destroy()Description copied from interface:UserAuth
Free any system resources used by the module. -
doAuth
- Throws:
Exception
-
toString
-