
@Component public class CachedDataProvider extends Object implements net.trajano.ms.core.NonceOps
| Modifier and Type | Field and Description |
|---|---|
private org.springframework.cache.CacheManager |
cm |
private org.springframework.cache.Cache |
jwksCache
This is a cache of JWKs.
|
private static org.slf4j.Logger |
LOG |
static int |
MAX_NUMBER_OF_KEYS
Maximum number of keys to keep in the cache.
|
static int |
MIN_NUMBER_OF_KEYS
Miniumum number of keys to keep in the cache.
|
private org.springframework.cache.Cache |
nonceCache
This is a cache of nonce.
|
private TokenGenerator |
tokenGenerator |
| Constructor and Description |
|---|
CachedDataProvider() |
| Modifier and Type | Method and Description |
|---|---|
org.jose4j.jwt.consumer.JwtConsumer |
buildConsumer()
Creates a JWT Consumer that performs no verification.
|
org.jose4j.jwt.consumer.JwtConsumer |
buildConsumer(org.jose4j.jwk.HttpsJwks jwks,
List<String> audience) |
void |
buildJwks()
Builds JWKS if necessary after 60 seconds, but only builds
2 at a time.
|
private org.jose4j.jwk.RsaJsonWebKey |
buildNewRsaKey() |
boolean |
claimNonce(String nonce) |
org.jose4j.jwk.RsaJsonWebKey |
getASigningKey()
Gets a single signing key.
|
private org.springframework.cache.Cache |
getCache(String cacheName) |
org.jose4j.jwk.JsonWebKeySet |
getKeySet()
Builds the keys from the cache.
|
void |
init() |
String |
newNonce() |
private static final org.slf4j.Logger LOG
public static final int MAX_NUMBER_OF_KEYS
public static final int MIN_NUMBER_OF_KEYS
@Autowired(required=false) private org.springframework.cache.CacheManager cm
private org.springframework.cache.Cache jwksCache
private org.springframework.cache.Cache nonceCache
@Autowired private TokenGenerator tokenGenerator
public org.jose4j.jwt.consumer.JwtConsumer buildConsumer()
public org.jose4j.jwt.consumer.JwtConsumer buildConsumer(org.jose4j.jwk.HttpsJwks jwks,
List<String> audience)
@Scheduled(fixedDelay=60000L) public void buildJwks()
private org.jose4j.jwk.RsaJsonWebKey buildNewRsaKey()
public boolean claimNonce(String nonce)
claimNonce in interface net.trajano.ms.core.NonceOpspublic org.jose4j.jwk.RsaJsonWebKey getASigningKey()
private org.springframework.cache.Cache getCache(String cacheName)
public org.jose4j.jwk.JsonWebKeySet getKeySet()
@PostConstruct public void init()
public String newNonce()
newNonce in interface net.trajano.ms.core.NonceOpsCopyright © 2012–2018 Trajano. All rights reserved.