public class GuavaCachedJwkProvider extends java.lang.Object implements JwkProvider
Constructor and Description |
---|
GuavaCachedJwkProvider(JwkProvider provider)
Creates a new provider that will cache up to 5 jwks for at most 10 minutes
|
GuavaCachedJwkProvider(JwkProvider provider,
long size,
long expiresIn,
java.util.concurrent.TimeUnit expiresUnit)
Creates a new cached provider specifying cache size and ttl
|
Modifier and Type | Method and Description |
---|---|
Jwk |
get(java.lang.String keyId)
Returns a jwk using the kid value
|
public GuavaCachedJwkProvider(JwkProvider provider)
provider
- fallback provider to use when jwk is not cachedpublic GuavaCachedJwkProvider(JwkProvider provider, long size, long expiresIn, java.util.concurrent.TimeUnit expiresUnit)
provider
- fallback provider to use when jwk is not cachedsize
- number of jwt to cacheexpiresIn
- amount of time a jwk will live in the cacheexpiresUnit
- unit of the expiresIn parameterpublic Jwk get(java.lang.String keyId) throws JwkException
JwkProvider
get
in interface JwkProvider
keyId
- value of kid found in JWTSigningKeyNotFoundException
- if no jwk can be found using the given kidJwkException