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
Constructors -
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 superclassvoidinitialise(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:
initialisein interfaceAuthenticator- Overrides:
initialisein classOpenAuthenticator- Parameters:
sessionManager- aSessionManagerinstance that can be used for invalidating and ejecting user sessions in the Liberator.delayedResultReceiver- aDelayedResultReceiverinstance that can be used for sending delayed authentication results after anAuthenticationResult.DELAYEDis used.serverNode- aServerNodeinstance 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:
checkUserin interfaceAuthenticator- Overrides:
checkUserin classOpenAuthenticator- Parameters:
session- theUserSessionobject containing information about the user and their login details.- Returns:
- an
AuthenticationResultinstance - usuallyAuthenticationResult.OK,AuthenticationResult.DENYor one of the specific failure results such asAuthenticationResult.INVALID_USER. - See Also:
-