public static class JWTVerifier.BaseVerification extends 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(String name,
Integer... items)
Require a specific Array Claim to contain at least the given items.
|
Verification |
withArrayClaim(String name,
String... items)
Require a specific Array Claim to contain at least the given items.
|
Verification |
withAudience(String... audience)
Require a specific Audience ("aud") claim.
|
Verification |
withClaim(String name,
Boolean value)
Require a specific Claim value.
|
Verification |
withClaim(String name,
Date value)
Require a specific Claim value.
|
Verification |
withClaim(String name,
Double value)
Require a specific Claim value.
|
Verification |
withClaim(String name,
Integer value)
Require a specific Claim value.
|
Verification |
withClaim(String name,
Long value)
Require a specific Claim value.
|
Verification |
withClaim(String name,
String value)
Require a specific Claim value.
|
Verification |
withIssuer(String issuer)
Require a specific Issuer ("iss") claim.
|
Verification |
withJWTId(String jwtId)
Require a specific JWT Id ("jti") claim.
|
Verification |
withSubject(String subject)
Require a specific Subject ("sub") claim.
|
public Verification withIssuer(String issuer)
withIssuer in interface Verificationissuer - the required Issuer valuepublic Verification withSubject(String subject)
withSubject in interface Verificationsubject - the required Subject valuepublic Verification withAudience(String... audience)
withAudience in interface Verificationaudience - the required Audience valuepublic Verification acceptLeeway(long leeway) throws IllegalArgumentException
acceptLeeway in interface Verificationleeway - the window in seconds in which the Not Before, Issued At and Expires At Claims will still be valid.IllegalArgumentException - if leeway is negative.public Verification acceptExpiresAt(long leeway) throws IllegalArgumentException
acceptExpiresAt in interface Verificationleeway - the window in seconds in which the Expires At Claim will still be valid.IllegalArgumentException - if leeway is negative.public Verification acceptNotBefore(long leeway) throws IllegalArgumentException
acceptNotBefore in interface Verificationleeway - the window in seconds in which the Not Before Claim will still be valid.IllegalArgumentException - if leeway is negative.public Verification acceptIssuedAt(long leeway) throws IllegalArgumentException
acceptIssuedAt in interface Verificationleeway - the window in seconds in which the Issued At Claim will still be valid.IllegalArgumentException - if leeway is negative.public Verification withJWTId(String jwtId)
withJWTId in interface VerificationjwtId - the required Id valuepublic Verification withClaim(String name, Boolean value) throws IllegalArgumentException
withClaim in interface Verificationname - the Claim's name.value - the Claim's value.IllegalArgumentException - if the name is null.public Verification withClaim(String name, Integer value) throws IllegalArgumentException
withClaim in interface Verificationname - the Claim's name.value - the Claim's value.IllegalArgumentException - if the name is null.public Verification withClaim(String name, Long value) throws IllegalArgumentException
withClaim in interface Verificationname - the Claim's name.value - the Claim's value.IllegalArgumentException - if the name is null.public Verification withClaim(String name, Double value) throws IllegalArgumentException
withClaim in interface Verificationname - the Claim's name.value - the Claim's value.IllegalArgumentException - if the name is null.public Verification withClaim(String name, String value) throws IllegalArgumentException
withClaim in interface Verificationname - the Claim's name.value - the Claim's value.IllegalArgumentException - if the name is null.public Verification withClaim(String name, Date value) throws IllegalArgumentException
withClaim in interface Verificationname - the Claim's name.value - the Claim's value.IllegalArgumentException - if the name is null.public Verification withArrayClaim(String name, String... items) throws IllegalArgumentException
withArrayClaim in interface Verificationname - the Claim's name.items - the items the Claim must contain.IllegalArgumentException - if the name is null.public Verification withArrayClaim(String name, Integer... items) throws IllegalArgumentException
withArrayClaim in interface Verificationname - the Claim's name.items - the items the Claim must contain.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.Copyright © 2017. All rights reserved.