Package com.auth0.jwt
Class JWTVerifier
java.lang.Object
com.auth0.jwt.JWTVerifier
- All Implemented Interfaces:
JWTVerifier
The JWTVerifier class holds the verify method to assert that a given Token has not only a proper JWT format,
but also its signature matches.
This class is thread-safe.
- See Also:
JWTVerifier
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Verification
implementation that accepts all the expected Claim values for verification. -
Method Summary
Modifier and TypeMethodDescriptionverify(DecodedJWT jwt)
Perform the verification against the given decoded JWT, using any previous configured options.Perform the verification against the given Token, using any previous configured options.
-
Method Details
-
verify
Perform the verification against the given Token, using any previous configured options.- Specified by:
verify
in interfaceJWTVerifier
- Parameters:
token
- to verify.- Returns:
- a verified and decoded JWT.
- Throws:
AlgorithmMismatchException
- if the algorithm stated in the token's header is not equal to the one defined in theJWTVerifier
.SignatureVerificationException
- if the signature is invalid.TokenExpiredException
- if the token has expired.MissingClaimException
- if a claim to be verified is missing.IncorrectClaimException
- if a claim contained a different value than the expected one.JWTVerificationException
- if any of the verification steps fail
-
verify
Perform the verification against the given decoded JWT, using any previous configured options.- Specified by:
verify
in interfaceJWTVerifier
- Parameters:
jwt
- to verify.- Returns:
- a verified and decoded JWT.
- Throws:
AlgorithmMismatchException
- if the algorithm stated in the token's header is not equal to the one defined in theJWTVerifier
.SignatureVerificationException
- if the signature is invalid.TokenExpiredException
- if the token has expired.MissingClaimException
- if a claim to be verified is missing.IncorrectClaimException
- if a claim contained a different value than the expected one.JWTVerificationException
- if any of the verification steps fail
-