Package com.auth0.jwt.interfaces
Interface JWTVerifier
- All Known Implementing Classes:
JWTVerifier
public interface JWTVerifier
Used to verify the JWT for its signature and claims. Implementations must be thread-safe. Instances are created
using
Verification
.
try { JWTVerifier verifier = JWTVerifier.init(Algorithm.RSA256(publicKey, privateKey) .withIssuer("auth0") .build(); DecodedJWT jwt = verifier.verify("token"); } catch (JWTVerificationException e) { // invalid signature or claims }
-
Method Summary
Modifier and TypeMethodDescriptionverify
(DecodedJWT jwt) Performs the verification against the givenDecodedJWT
.Performs the verification against the given Token.
-
Method Details
-
verify
Performs the verification against the given Token.- Parameters:
token
- to verify.- Returns:
- a verified and decoded JWT.
- Throws:
JWTVerificationException
- if any of the verification steps fail
-
verify
Performs the verification against the givenDecodedJWT
.- Parameters:
jwt
- to verify.- Returns:
- a verified and decoded JWT.
- Throws:
JWTVerificationException
- if any of the verification steps fail
-