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
FieldsFields inherited from interface org.pac4j.core.credentials.authenticator.Authenticator
ALWAYS_VALIDATE -
Constructor Summary
ConstructorsConstructorDescriptionLocalCachingAuthenticator(Authenticator delegate, int cacheSize, int timeout, TimeUnit timeUnit) LocalCachingAuthenticator(Authenticator delegate, Store<Credentials, UserProfile> store) -
Method Summary
Modifier and TypeMethodDescriptionintgetStore()intprotected voidinternalInit(boolean forceReinit) Internal initialization of the object.booleanisCached(Credentials credentials) voidremoveFromCache(Credentials credentials) voidsetCacheSize(int cacheSize) voidsetDelegate(Authenticator delegate) voidsetStore(Store<Credentials, UserProfile> store) voidsetTimeout(int timeout) voidsetTimeUnit(TimeUnit timeUnit) toString()voidvalidate(Credentials credentials, WebContext context, SessionStore sessionStore) Validate the credentials.Methods inherited from class org.pac4j.core.util.InitializableObject
afterInternalInit, beforeInternalInit, getLastAttempt, getMaxAttempts, getMinTimeIntervalBetweenAttemptsInMilliseconds, getNbAttempts, init, init, isInitialized, reinit, setMaxAttempts, setMinTimeIntervalBetweenAttemptsInMilliseconds, shouldInitialize
-
Field Details
-
logger
protected final org.slf4j.Logger logger
-
-
Constructor Details
-
LocalCachingAuthenticator
public LocalCachingAuthenticator() -
LocalCachingAuthenticator
-
LocalCachingAuthenticator
public LocalCachingAuthenticator(Authenticator delegate, int cacheSize, int timeout, TimeUnit timeUnit)
-
-
Method Details
-
validate
Description copied from interface:AuthenticatorValidate the credentials. It should throw aCredentialsExceptionin case of failure.- Specified by:
validatein interfaceAuthenticator- Parameters:
credentials- the given credentialscontext- the web contextsessionStore- the session store
-
internalInit
protected void internalInit(boolean forceReinit) Description copied from class:InitializableObjectInternal initialization of the object.- Specified by:
internalInitin classInitializableObject
-
removeFromCache
-
isCached
-
getDelegate
-
setDelegate
-
getCacheSize
public int getCacheSize() -
setCacheSize
public void setCacheSize(int cacheSize) -
getTimeout
public int getTimeout() -
setTimeout
public void setTimeout(int timeout) -
getTimeUnit
-
setTimeUnit
-
getStore
-
setStore
-
toString
-