public static class JWTVerifier.BaseVerification extends java.lang.Object implements Verification
| Modifier and Type | Method and Description |
|---|---|
Verification |
acceptExpiresAt(long leeway)
Set a specific leeway window in seconds in which the Expires At ("exp") Claim will still be valid.
|
Verification |
acceptIssuedAt(long leeway)
Set a specific leeway window in seconds in which the Issued At ("iat") Claim will still be valid.
|
Verification |
acceptLeeway(long leeway)
Define the default window in seconds in which the Not Before, Issued At and Expires At Claims will still be valid.
|
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 |
build(Clock clock)
Creates a new and reusable instance of the JWTVerifier with the configuration already provided.
|
Verification |
withArrayClaim(java.lang.String name,
java.lang.Integer... items)
Require a specific Array Claim to contain at least the given items.
|
Verification |
withArrayClaim(java.lang.String name,
java.lang.String... items)
Require a specific Array Claim to contain at least the given items.
|
Verification |
withAudience(java.lang.String... audience)
Require a specific Audience ("aud") claim.
|
Verification |
withClaim(java.lang.String name,
java.lang.Boolean value)
Require a specific Claim value.
|
Verification |
withClaim(java.lang.String name,
java.util.Date value)
Require a specific Claim value.
|
Verification |
withClaim(java.lang.String name,
java.lang.Double value)
Require a specific Claim value.
|
Verification |
withClaim(java.lang.String name,
java.lang.Integer value)
Require a specific Claim value.
|
Verification |
withClaim(java.lang.String name,
java.lang.Long value)
Require a specific Claim value.
|
Verification |
withClaim(java.lang.String name,
java.lang.String value)
Require a specific Claim value.
|
Verification |
withIssuer(java.lang.String issuer)
Require a specific Issuer ("iss") claim.
|
Verification |
withJWTId(java.lang.String jwtId)
Require a specific JWT Id ("jti") claim.
|
Verification |
withSubject(java.lang.String subject)
Require a specific Subject ("sub") claim.
|
public Verification withIssuer(java.lang.String issuer)
withIssuer in interface Verificationissuer - the required Issuer valuepublic Verification withSubject(java.lang.String subject)
withSubject in interface Verificationsubject - the required Subject valuepublic Verification withAudience(java.lang.String... audience)
withAudience in interface Verificationaudience - the required Audience valuepublic Verification acceptLeeway(long leeway) throws java.lang.IllegalArgumentException
acceptLeeway in interface Verificationleeway - 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 Verification acceptExpiresAt(long leeway) throws java.lang.IllegalArgumentException
acceptExpiresAt in interface Verificationleeway - the window in seconds in which the Expires At Claim will still be valid.java.lang.IllegalArgumentException - if leeway is negative.public Verification acceptNotBefore(long leeway) throws java.lang.IllegalArgumentException
acceptNotBefore in interface Verificationleeway - the window in seconds in which the Not Before Claim will still be valid.java.lang.IllegalArgumentException - if leeway is negative.public Verification acceptIssuedAt(long leeway) throws java.lang.IllegalArgumentException
acceptIssuedAt in interface Verificationleeway - the window in seconds in which the Issued At Claim will still be valid.java.lang.IllegalArgumentException - if leeway is negative.public Verification withJWTId(java.lang.String jwtId)
withJWTId in interface VerificationjwtId - the required Id valuepublic Verification withClaim(java.lang.String name, java.lang.Boolean value) throws java.lang.IllegalArgumentException
withClaim in interface Verificationname - the Claim's name.value - the Claim's value.java.lang.IllegalArgumentException - if the name is null.public Verification withClaim(java.lang.String name, java.lang.Integer value) throws java.lang.IllegalArgumentException
withClaim in interface Verificationname - the Claim's name.value - the Claim's value.java.lang.IllegalArgumentException - if the name is null.public Verification withClaim(java.lang.String name, java.lang.Long value) throws java.lang.IllegalArgumentException
withClaim in interface Verificationname - the Claim's name.value - the Claim's value.java.lang.IllegalArgumentException - if the name is null.public Verification withClaim(java.lang.String name, java.lang.Double value) throws java.lang.IllegalArgumentException
withClaim in interface Verificationname - the Claim's name.value - the Claim's value.java.lang.IllegalArgumentException - if the name is null.public Verification withClaim(java.lang.String name, java.lang.String value) throws java.lang.IllegalArgumentException
withClaim in interface Verificationname - the Claim's name.value - the Claim's value.java.lang.IllegalArgumentException - if the name is null.public Verification withClaim(java.lang.String name, java.util.Date value) throws java.lang.IllegalArgumentException
withClaim in interface Verificationname - the Claim's name.value - the Claim's value.java.lang.IllegalArgumentException - if the name is null.public Verification withArrayClaim(java.lang.String name, java.lang.String... items) throws java.lang.IllegalArgumentException
withArrayClaim in interface Verificationname - the Claim's name.items - the items the Claim must contain.java.lang.IllegalArgumentException - if the name is null.public Verification withArrayClaim(java.lang.String name, java.lang.Integer... items) throws java.lang.IllegalArgumentException
withArrayClaim in interface Verificationname - the Claim's name.items - the items the Claim must contain.java.lang.IllegalArgumentException - if the name is null.public JWTVerifier build()
build in interface Verificationpublic JWTVerifier build(Clock clock)
clock - the instance that will handle the current time.