public final class NimbusJwtDecoder extends java.lang.Object implements JwtDecoder
JwtDecoder
which takes a raw Nimbus
configuration.Modifier and Type | Class and Description |
---|---|
static class |
NimbusJwtDecoder.JwkSetUriJwtDecoderBuilder
A builder for creating
NimbusJwtDecoder instances based on a
JWK Set
uri. |
static class |
NimbusJwtDecoder.PublicKeyJwtDecoderBuilder
A builder for creating
NimbusJwtDecoder instances based on a public key. |
static class |
NimbusJwtDecoder.SecretKeyJwtDecoderBuilder
A builder for creating
NimbusJwtDecoder instances based on a
SecretKey . |
Constructor and Description |
---|
NimbusJwtDecoder(com.nimbusds.jwt.proc.JWTProcessor<com.nimbusds.jose.proc.SecurityContext> jwtProcessor)
Configures a
NimbusJwtDecoder with the given parameters |
Modifier and Type | Method and Description |
---|---|
Jwt |
decode(java.lang.String token)
Decode and validate the JWT from its compact claims representation format
|
void |
setClaimSetConverter(org.springframework.core.convert.converter.Converter<java.util.Map<java.lang.String,java.lang.Object>,java.util.Map<java.lang.String,java.lang.Object>> claimSetConverter)
Use the following
Converter for manipulating the JWT's claim set |
void |
setJwtValidator(OAuth2TokenValidator<Jwt> jwtValidator)
Use this
Jwt Validator |
static NimbusJwtDecoder.JwkSetUriJwtDecoderBuilder |
withJwkSetUri(java.lang.String jwkSetUri)
Use the given JWK Set
uri.
|
static NimbusJwtDecoder.PublicKeyJwtDecoderBuilder |
withPublicKey(java.security.interfaces.RSAPublicKey key)
Use the given public key to validate JWTs
|
static NimbusJwtDecoder.SecretKeyJwtDecoderBuilder |
withSecretKey(javax.crypto.SecretKey secretKey)
Use the given
SecretKey to validate the MAC on a JSON Web Signature (JWS). |
public NimbusJwtDecoder(com.nimbusds.jwt.proc.JWTProcessor<com.nimbusds.jose.proc.SecurityContext> jwtProcessor)
NimbusJwtDecoder
with the given parametersjwtProcessor
- - the JWTProcessor
to usepublic void setJwtValidator(OAuth2TokenValidator<Jwt> jwtValidator)
Jwt
ValidatorjwtValidator
- - the Jwt Validator to usepublic void setClaimSetConverter(org.springframework.core.convert.converter.Converter<java.util.Map<java.lang.String,java.lang.Object>,java.util.Map<java.lang.String,java.lang.Object>> claimSetConverter)
Converter
for manipulating the JWT's claim setclaimSetConverter
- the Converter
to usepublic Jwt decode(java.lang.String token) throws JwtException
decode
in interface JwtDecoder
token
- the JWT valueJwt
JwtException
public static NimbusJwtDecoder.JwkSetUriJwtDecoderBuilder withJwkSetUri(java.lang.String jwkSetUri)
jwkSetUri
- the JWK Set uri to useNimbusJwtDecoder.JwkSetUriJwtDecoderBuilder
for further configurationspublic static NimbusJwtDecoder.PublicKeyJwtDecoderBuilder withPublicKey(java.security.interfaces.RSAPublicKey key)
key
- the public key to useNimbusJwtDecoder.PublicKeyJwtDecoderBuilder
for further configurationspublic static NimbusJwtDecoder.SecretKeyJwtDecoderBuilder withSecretKey(javax.crypto.SecretKey secretKey)
SecretKey
to validate the MAC on a JSON Web Signature (JWS).secretKey
- the SecretKey
used to validate the MACNimbusJwtDecoder.SecretKeyJwtDecoderBuilder
for further configurations