public class JwksStoreService extends Object
Modifier and Type | Field and Description |
---|---|
static Duration |
JWKS_STORE_DEFAULT_CACHE_MISS_CACHE_TIME_MS
The default cache time before reload the cache in case of cache miss ms.
|
static Duration |
JWKS_STORE_DEFAULT_CACHE_TIMEOUT_MS
The default cache timeout in ms.
|
Constructor and Description |
---|
JwksStoreService()
Default 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.
|
Modifier and Type | Method and Description |
---|---|
JwksStore |
configureJwksStore(String uid,
Duration cacheTimeout,
Duration cacheMissCacheTime,
URL jwkUrl)
Deprecated.
Use
configureJwksStore(String, Duration, Duration, URL, Clock) with an explicit clock. |
JwksStore |
configureJwksStore(String uid,
Duration cacheTimeout,
Duration cacheMissCacheTime,
URL jwkUrl,
Clock clock)
Configure a JWKs store.
|
JwksStore |
getJwksStore(String uid)
Returns the appropriate JWKs store.
|
void |
removeJwksStore(String uid)
Remove the corresponding jwks store if exist.
|
public static final Duration JWKS_STORE_DEFAULT_CACHE_TIMEOUT_MS
public static final Duration JWKS_STORE_DEFAULT_CACHE_MISS_CACHE_TIME_MS
public JwksStoreService()
public JwksStoreService(int readTimeout, int connTimeout)
readTimeout
- the read timeoutconnTimeout
- the connection timeoutpublic JwksStoreService(SimpleHTTPClient simpleHTTPClient)
simpleHTTPClient
- the HTTP clientpublic JwksStore getJwksStore(String uid)
uid
- Reference to the jwks store. Note that the uid check is case insensitive@Deprecated public JwksStore configureJwksStore(String uid, Duration cacheTimeout, Duration cacheMissCacheTime, URL jwkUrl) throws FailedToLoadJWKException
configureJwksStore(String, Duration, Duration, URL, Clock)
with an explicit clock.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 applicationFailedToLoadJWKException
- if the jwks can't be reloaded.public JwksStore configureJwksStore(String uid, Duration cacheTimeout, Duration cacheMissCacheTime, URL jwkUrl, Clock clock) throws FailedToLoadJWKException
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.FailedToLoadJWKException
- if the jwks can't be reloaded.public void removeJwksStore(String uid)
uid
- the uid. Note that the uid check isn't case sensitiveCopyright 2011-2017 ForgeRock AS.