Class CachingAccessTokenResolver
java.lang.Object
org.forgerock.http.oauth2.resolver.CachingAccessTokenResolver
- All Implemented Interfaces:
AccessTokenResolver
A
CachingAccessTokenResolver
is a delegating AccessTokenResolver
that uses a write-through cache
to enable fast AccessTokenInfo
resolution.-
Constructor Summary
ConstructorsConstructorDescriptionCachingAccessTokenResolver
(TimeService time, AccessTokenResolver resolver, PerItemEvictionStrategyCache<String, Promise<AccessTokenInfo, AccessTokenException>> cache) Builds aCachingAccessTokenResolver
delegating to the givenAccessTokenResolver
using the given (pre-configured) cache. -
Method Summary
Modifier and TypeMethodDescriptionResolves a given access token against an authorization server.
-
Constructor Details
-
CachingAccessTokenResolver
public CachingAccessTokenResolver(TimeService time, AccessTokenResolver resolver, PerItemEvictionStrategyCache<String, Promise<AccessTokenInfo, AccessTokenException>> cache) Builds aCachingAccessTokenResolver
delegating to the givenAccessTokenResolver
using the given (pre-configured) cache.- Parameters:
time
- Time service used to compute the token cache time-to-liveresolver
- resolver to delegates tocache
- access token cache
-
-
Method Details
-
resolve
Description copied from interface:AccessTokenResolver
Resolves a given access token against an authorization server.- Specified by:
resolve
in interfaceAccessTokenResolver
- Parameters:
context
- Context chain used to keep a relationship between requests (tracking)token
- token identifier to be resolved- Returns:
- a promise completed either with a valid
AccessTokenInfo
(well-formed, known by the server), or by an exception
-