Package examples
Class KeyMasterAuthenticator
java.lang.Object
examples.OpenAuthenticator
examples.KeyMasterAuthenticator
- All Implemented Interfaces:
Authenticator
An example Authenticator that shows how to check KeyMaster tokens in a Liberator Auth Module.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncheckUser
(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, String loggerName) Store the sessionManager for use when checking tokensMethods inherited from class examples.OpenAuthenticator
authoriseHTTP, checkPermissionUpdate, checkRead, checkUpdate, checkWrite, discardObject, globalPermissionUpdate, mapObject, newObject, releaseObject, releaseUser, requestObject, shutdown
-
Constructor Details
-
KeyMasterAuthenticator
public KeyMasterAuthenticator()
-
-
Method Details
-
initialise
public void initialise(SessionManager sessionManager, DelayedResultReceiver delayedResultReceiver, ServerNode serverNode, 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
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:
-