protected JsonWebSignature configureJsonWebSignatureForTokenSigning ( final OAuthRegisteredService svc , final JsonWebSignature jws , final PublicJsonWebKey jsonWebKey ) { LOGGER . debug ( "Service [{}] is set to sign id tokens" , svc ) ; jws . setKey ( jsonWebKey . getPrivateKey ( ) ) ; jws . setAlgorithmConstraints ( AlgorithmConstraints . DISALLOW_NONE ) ; if ( StringUtils . isNotBlank ( jsonWebKey . getKeyId ( ) ) ) { jws . setKeyIdHeaderValue ( jsonWebKey . getKeyId ( ) ) ; } LOGGER . debug ( "Signing id token with key id header value [{}]" , jws . getKeyIdHeaderValue ( ) ) ; jws . setAlgorithmHeaderValue ( getJsonWebKeySigningAlgorithm ( svc ) ) ; LOGGER . debug ( "Signing id token with algorithm [{}]" , jws . getAlgorithmHeaderValue ( ) ) ; return jws ; }
Configure json web signature for id token signing .