Class JwksStoreService
java.lang.Object
org.forgerock.json.jose.jwk.store.JwksStoreService
Manage the jwks store, to avoid having more than one jwks store for the same JWKs_URI unnecessary.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDeprecated.JwksStoreService
(int readTimeout, int connTimeout) Deprecated.Prefer using the constructorJwksStoreService(Client client)
where timeouts are in control of the client applicationJwksStoreService
(Client client) Constructor with a HTTP client, that will be used to connect to the JWKS_URI. -
Method Summary
Modifier and TypeMethodDescriptionconfigureJwksStore
(String uid, Duration cacheTimeout, Duration cacheMissCacheTime, URL jwkUrl) Deprecated.UseconfigureJwksStore(String, Duration, Duration, URL, Clock)
with an explicit clock.configureJwksStore
(String uid, Duration cacheTimeout, Duration cacheMissCacheTime, URL jwkUrl, Clock clock) Deprecated.configureJwksStoreAsync
(String uid, Duration cacheTimeout, Duration cacheMissCacheTime, URL jwkUrl, Clock clock) Configure a JWKs store.getJwksStore
(String uid) Returns the appropriate JWKs store.void
removeJwksStore
(String uid) Remove the corresponding jwks store if exist.
-
Field Details
-
JWKS_STORE_DEFAULT_CACHE_TIMEOUT_MS
The default cache timeout in ms. -
JWKS_STORE_DEFAULT_CACHE_MISS_CACHE_TIME_MS
The default cache time before reload the cache in case of cache miss ms.
-
-
Constructor Details
-
JwksStoreService
Deprecated.Prefer using the constructorJwksStoreService(Client client)
in which you provide your own instance ofClient
. This one does instantiate a specific instance of AsyncHttpClient but does not allow any custom filter processing, nor does it close it properly.Default constructor. -
JwksStoreService
Deprecated.Prefer using the constructorJwksStoreService(Client client)
where timeouts are in control of the client applicationConstructor with read and connection timeout. It's used for the connection to the JWKs_URI.- Parameters:
readTimeout
- the read timeoutconnTimeout
- the connection timeout
-
JwksStoreService
Constructor with a HTTP client, that will be used to connect to the JWKS_URI.- Parameters:
client
- the HTTP client
-
-
Method Details
-
getJwksStore
Returns the appropriate JWKs store.- Parameters:
uid
- Reference to the jwks store. Note that the uid check is case insensitive- Returns:
- a JWKs Store for the corresponding UID. If doesn't exist, returns null
-
configureJwksStore
@Deprecated public JwksStore configureJwksStore(String uid, Duration cacheTimeout, Duration cacheMissCacheTime, URL jwkUrl) throws FailedToLoadJWKException Deprecated.UseconfigureJwksStore(String, Duration, Duration, URL, Clock)
with an explicit clock.Configure a JWKs store.- Parameters:
uid
- the unique identifier for this storecacheTimeout
- a cache timeout to avoid reloading the cache all the time when doing encryptioncacheMissCacheTime
- the cache time before reload the cache in case of cache miss.jwkUrl
- the jwk url hosted by the client application- Returns:
- the JWKs store corresponding
- Throws:
FailedToLoadJWKException
- if the jwks can't be reloaded.
-
configureJwksStore
@Deprecated public JwksStore configureJwksStore(String uid, Duration cacheTimeout, Duration cacheMissCacheTime, URL jwkUrl, Clock clock) throws FailedToLoadJWKException Deprecated.Configure a JWKs store.- Parameters:
uid
- the unique identifier for this storecacheTimeout
- a cache timeout to avoid reloading the cache all the time when doing encryptioncacheMissCacheTime
- the cache time before reload the cache in case of cache miss.jwkUrl
- the jwk url hosted by the client applicationclock
- clock to use for measuring timeouts.- Returns:
- the JWKs store corresponding
- Throws:
FailedToLoadJWKException
- if the jwks can't be reloaded.
-
configureJwksStoreAsync
public Promise<JwksStore,FailedToLoadJWKException> configureJwksStoreAsync(String uid, Duration cacheTimeout, Duration cacheMissCacheTime, URL jwkUrl, Clock clock) Configure a JWKs store.- Parameters:
uid
- the unique identifier for this storecacheTimeout
- a cache timeout to avoid reloading the cache all the time when doing encryptioncacheMissCacheTime
- the cache time before reload the cache in case of cache miss.jwkUrl
- the jwk url hosted by the client applicationclock
- clock to use for measuring timeouts.- Returns:
- the JWKs store corresponding
-
removeJwksStore
Remove the corresponding jwks store if exist.- Parameters:
uid
- the uid. Note that the uid check isn't case sensitive
-
JwksStoreService(Client client)
in which you provide your own instance ofClient
.