public final class NimbusReactiveJwtDecoder extends java.lang.Object implements ReactiveJwtDecoder
ReactiveJwtDecoder
that "decodes" a
JSON Web Token (JWT) and additionally verifies it's digital signature if the JWT is a
JSON Web Signature (JWS). The public key used for verification is obtained from the
JSON Web Key (JWK) Set URL
supplied via the constructor.
NOTE: This implementation uses the Nimbus JOSE + JWT SDK internally.
ReactiveJwtDecoder
,
JSON Web Token (JWT),
JSON Web Signature (JWS),
JSON Web Key (JWK),
Nimbus JOSE + JWT SDKConstructor and Description |
---|
NimbusReactiveJwtDecoder(java.security.interfaces.RSAPublicKey publicKey) |
NimbusReactiveJwtDecoder(java.lang.String jwkSetUrl)
Constructs a
NimbusJwtDecoderJwkSupport using the provided parameters. |
Modifier and Type | Method and Description |
---|---|
reactor.core.publisher.Mono<Jwt> |
decode(java.lang.String token)
Decodes the JWT from it's compact claims representation format and returns a
Jwt . |
void |
setJwtValidator(OAuth2TokenValidator<Jwt> jwtValidator)
Use the provided
OAuth2TokenValidator to validate incoming Jwt s. |
public NimbusReactiveJwtDecoder(java.security.interfaces.RSAPublicKey publicKey)
public NimbusReactiveJwtDecoder(java.lang.String jwkSetUrl)
NimbusJwtDecoderJwkSupport
using the provided parameters.jwkSetUrl
- the JSON Web Key (JWK) Set URL
public void setJwtValidator(OAuth2TokenValidator<Jwt> jwtValidator)
OAuth2TokenValidator
to validate incoming Jwt
s.jwtValidator
- the OAuth2TokenValidator
to usepublic reactor.core.publisher.Mono<Jwt> decode(java.lang.String token) throws JwtException
ReactiveJwtDecoder
Jwt
.decode
in interface ReactiveJwtDecoder
token
- the JWT valueJwt
JwtException
- if an error occurs while attempting to decode the JWT