public static class JWTVerifier.Verification
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
JWTVerifier.Verification |
acceptExpiresAt(long leeway)
Set a specific leeway window in seconds in which the Expires At ("exp") Claim will still be valid.
|
JWTVerifier.Verification |
acceptIssuedAt(long leeway)
Set a specific leeway window in seconds in which the Issued At ("iat") Claim will still be valid.
|
JWTVerifier.Verification |
acceptLeeway(long leeway)
Define the default window in milliseconds in which the Not Before, Issued At and Expires At Claims will still be valid.
|
JWTVerifier.Verification |
acceptNotBefore(long leeway)
Set a specific leeway window in seconds in which the Not Before ("nbf") Claim will still be valid.
|
JWTVerifier |
build()
Creates a new and reusable instance of the JWTVerifier with the configuration already provided.
|
JWTVerifier.Verification |
withAudience(java.lang.String... audience)
Require a specific Audience ("aud") claim.
|
JWTVerifier.Verification |
withClaim(java.lang.String name,
java.lang.Object value)
Require a specific Claim value.
|
JWTVerifier.Verification |
withIssuer(java.lang.String issuer)
Require a specific Issuer ("iss") claim.
|
JWTVerifier.Verification |
withJWTId(java.lang.String jwtId)
Require a specific JWT Id ("jti") claim.
|
JWTVerifier.Verification |
withSubject(java.lang.String subject)
Require a specific Subject ("sub") claim.
|
public JWTVerifier.Verification withIssuer(java.lang.String issuer)
issuer - the required Issuer valuepublic JWTVerifier.Verification withSubject(java.lang.String subject)
subject - the required Subject valuepublic JWTVerifier.Verification withAudience(java.lang.String... audience)
audience - the required Audience valuepublic JWTVerifier.Verification acceptLeeway(long leeway) throws java.lang.IllegalArgumentException
leeway - the window in seconds in which the Not Before, Issued At and Expires At Claims will still be valid.java.lang.IllegalArgumentException - if leeway is negative.public JWTVerifier.Verification acceptExpiresAt(long leeway) throws java.lang.IllegalArgumentException
leeway - the window in seconds in which the Expires At Claim will still be valid.java.lang.IllegalArgumentException - if leeway is negative.public JWTVerifier.Verification acceptNotBefore(long leeway) throws java.lang.IllegalArgumentException
leeway - the window in seconds in which the Not Before Claim will still be valid.java.lang.IllegalArgumentException - if leeway is negative.public JWTVerifier.Verification acceptIssuedAt(long leeway) throws java.lang.IllegalArgumentException
leeway - the window in seconds in which the Issued At Claim will still be valid.java.lang.IllegalArgumentException - if leeway is negative.public JWTVerifier.Verification withJWTId(java.lang.String jwtId)
jwtId - the required Id valuepublic JWTVerifier.Verification withClaim(java.lang.String name, java.lang.Object value) throws java.lang.IllegalArgumentException
name - the Claim's namevalue - the Claim's value. Must be an instance of Integer, Double, Boolean, Date or String class.java.lang.IllegalArgumentException - if the name is null or the value class is not allowed.public JWTVerifier build()