public final class NimbusJwtDecoderJwkSupport extends java.lang.Object implements JwtDecoder
JwtDecoder
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.
JwtDecoder
,
JSON Web Token (JWT),
JSON Web Signature (JWS),
JSON Web Key (JWK),
Nimbus JOSE + JWT SDKConstructor and Description |
---|
NimbusJwtDecoderJwkSupport(java.lang.String jwkSetUrl)
Constructs a
NimbusJwtDecoderJwkSupport using the provided parameters. |
NimbusJwtDecoderJwkSupport(java.lang.String jwkSetUrl,
java.lang.String jwsAlgorithm)
Constructs a
NimbusJwtDecoderJwkSupport using the provided parameters. |
Modifier and Type | Method and Description |
---|---|
Jwt |
decode(java.lang.String token)
Decodes the JWT from it's compact claims representation format and returns a
Jwt . |
public NimbusJwtDecoderJwkSupport(java.lang.String jwkSetUrl)
NimbusJwtDecoderJwkSupport
using the provided parameters.jwkSetUrl
- the JSON Web Key (JWK) Set URL
public NimbusJwtDecoderJwkSupport(java.lang.String jwkSetUrl, java.lang.String jwsAlgorithm)
NimbusJwtDecoderJwkSupport
using the provided parameters.jwkSetUrl
- the JSON Web Key (JWK) Set URL
jwsAlgorithm
- the JSON Web Algorithm (JWA) used for verifying the digital signaturespublic Jwt decode(java.lang.String token) throws JwtException
JwtDecoder
Jwt
.decode
in interface JwtDecoder
token
- the JWT valueJwt
JwtException
- if an error occurs while attempting to decode the JWT