Class LocalCachingAuthenticator
java.lang.Object
org.pac4j.core.util.InitializableObject
org.pac4j.core.credentials.authenticator.LocalCachingAuthenticator
- All Implemented Interfaces:
Authenticator
An authenticator that caches the result of an authentication based on the credentials.
Add the
guava
dependency to use this class.- Since:
- 1.8
- Author:
- Misagh Moayyed
-
Field Summary
Fields inherited from interface org.pac4j.core.credentials.authenticator.Authenticator
ALWAYS_VALIDATE
-
Constructor Summary
ConstructorDescriptionLocalCachingAuthenticator
(Authenticator delegate, int cacheSize, int timeout, TimeUnit timeUnit) LocalCachingAuthenticator
(Authenticator delegate, Store<Credentials, UserProfile> store) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
internalInit
(boolean forceReinit) Internal initialization of the object.boolean
isCached
(Credentials credentials) void
removeFromCache
(Credentials credentials) validate
(CallContext ctx, Credentials credentials) Validate the credentials.Methods inherited from class org.pac4j.core.util.InitializableObject
afterInternalInit, beforeInternalInit, getNbAttempts, init, init, isInitialized, reinit, shouldInitialize
-
Constructor Details
-
LocalCachingAuthenticator
public LocalCachingAuthenticator() -
LocalCachingAuthenticator
-
LocalCachingAuthenticator
public LocalCachingAuthenticator(Authenticator delegate, int cacheSize, int timeout, TimeUnit timeUnit)
-
-
Method Details
-
validate
Description copied from interface:Authenticator
Validate the credentials. It should throw aCredentialsException
in case of failure.- Specified by:
validate
in interfaceAuthenticator
- Parameters:
ctx
- the contextcredentials
- the given credentials- Returns:
- the credentials
-
internalInit
protected void internalInit(boolean forceReinit) Description copied from class:InitializableObject
Internal initialization of the object.- Specified by:
internalInit
in classInitializableObject
-
removeFromCache
-
isCached
-