Search in sources :

Example 1 with JwtTokenHandler

use of org.forgerock.selfservice.stages.tokenhandlers.JwtTokenHandler in project OpenAM by OpenRock.

the class JwtSnapshotTokenHandlerFactory method configureJwtTokenHandler.

private SnapshotTokenHandler configureJwtTokenHandler(JwtTokenHandlerConfig config) {
    SigningManager signingManager = new SigningManager();
    SigningHandler signingHandler = signingManager.newHmacSigningHandler(config.getSharedKey());
    KeyPair keyPair = provider.getKeyPair(config.getKeyPairAlgorithm(), config.getKeyPairSize());
    return new JwtTokenHandler(config.getJweAlgorithm(), config.getEncryptionMethod(), keyPair, config.getJwsAlgorithm(), signingHandler, config.getTokenLifeTimeInSeconds());
}
Also used : KeyPair(java.security.KeyPair) JwtTokenHandler(org.forgerock.selfservice.stages.tokenhandlers.JwtTokenHandler) SigningHandler(org.forgerock.json.jose.jws.handlers.SigningHandler) SigningManager(org.forgerock.json.jose.jws.SigningManager)

Aggregations

KeyPair (java.security.KeyPair)1 SigningManager (org.forgerock.json.jose.jws.SigningManager)1 SigningHandler (org.forgerock.json.jose.jws.handlers.SigningHandler)1 JwtTokenHandler (org.forgerock.selfservice.stages.tokenhandlers.JwtTokenHandler)1