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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.JwksStoreService(int readTimeout, int connTimeout) Constructor with read and connection timeout.JwksStoreService(SimpleHTTPClient simpleHTTPClient) 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) Configure a JWKs store.getJwksStore(String uid) Returns the appropriate JWKs store.voidremoveJwksStore(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
public JwksStoreService()Default constructor. -
JwksStoreService
Constructor 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:
simpleHTTPClient- 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
public JwksStore configureJwksStore(String uid, Duration cacheTimeout, Duration cacheMissCacheTime, URL jwkUrl) throws FailedToLoadJWKException 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.
-
removeJwksStore
Remove the corresponding jwks store if exist.- Parameters:
uid- the uid. Note that the uid check isn't case sensitive
-