Package examples
Class KeyMasterAuthenticator
- java.lang.Object
-
- examples.OpenAuthenticator
-
- examples.KeyMasterAuthenticator
-
- All Implemented Interfaces:
Authenticator
public class KeyMasterAuthenticator extends OpenAuthenticator
An example Authenticator that shows how to check KeyMaster tokens in a Liberator Auth Module.
-
-
Constructor Summary
Constructors Constructor Description KeyMasterAuthenticator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthenticationResult
checkUser(UserSession session)
If the user is in our list of KeyMaster users then check the password is a valid token, otherwise delegate to the superclassvoid
initialise(SessionManager sessionManager, DelayedResultReceiver delayedResultReceiver, ServerNode serverNode, java.lang.String loggerName)
Store the sessionManager for use when checking tokens-
Methods inherited from class examples.OpenAuthenticator
authoriseHTTP, checkPermissionUpdate, checkRead, checkUpdate, checkWrite, discardObject, globalPermissionUpdate, mapObject, newObject, releaseObject, releaseUser, requestObject, shutdown
-
-
-
-
Method Detail
-
initialise
public void initialise(SessionManager sessionManager, DelayedResultReceiver delayedResultReceiver, ServerNode serverNode, java.lang.String loggerName)
Store the sessionManager for use when checking tokens- Specified by:
initialise
in interfaceAuthenticator
- Overrides:
initialise
in classOpenAuthenticator
- Parameters:
sessionManager
- aSessionManager
instance that can be used for invalidating and ejecting user sessions in the Liberator.delayedResultReceiver
- aDelayedResultReceiver
instance that can be used for sending delayed authentication results after anAuthenticationResult.DELAYED
is used.serverNode
- aServerNode
instance that provides access to information about the server and its session count.loggerName
- the name of the logger that provides native logging output to the Liberator's auth log file (by default auth-rttpd.log).
-
checkUser
public AuthenticationResult checkUser(UserSession session)
If the user is in our list of KeyMaster users then check the password is a valid token, otherwise delegate to the superclass- Specified by:
checkUser
in interfaceAuthenticator
- Overrides:
checkUser
in classOpenAuthenticator
- Parameters:
session
- theUserSession
object containing information about the user and their login details.- Returns:
- an
AuthenticationResult
instance - usuallyAuthenticationResult.OK
,AuthenticationResult.DENY
or one of the specific failure results such asAuthenticationResult.INVALID_USER
. - See Also:
OpenAuthenticator.checkUser(com.caplin.server.auth.UserSession)
-
-