public interface 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.
|
Verification |
ignoreIssuedAt()
Skip the Issued At ("iat") date verification.
|
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.Long... 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 |
withClaimPresence(java.lang.String name)
Require a claim to be present, with any 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.
|
Verification withIssuer(java.lang.String... issuer)
issuer
- the required Issuer value. If multiple values are given, the claim must at least match one of themVerification withSubject(java.lang.String subject)
subject
- the required Subject valueVerification withAudience(java.lang.String... audience)
audience
- the required Audience valueVerification 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.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.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.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.Verification withJWTId(java.lang.String jwtId)
jwtId
- the required Id valueVerification withClaimPresence(java.lang.String name) throws java.lang.IllegalArgumentException
name
- the Claim's name.java.lang.IllegalArgumentException
- if the name is null.Verification withClaim(java.lang.String name, java.lang.Boolean value) throws java.lang.IllegalArgumentException
name
- the Claim's name.value
- the Claim's value.java.lang.IllegalArgumentException
- if the name is null.Verification withClaim(java.lang.String name, java.lang.Integer value) throws java.lang.IllegalArgumentException
name
- the Claim's name.value
- the Claim's value.java.lang.IllegalArgumentException
- if the name is null.Verification withClaim(java.lang.String name, java.lang.Long value) throws java.lang.IllegalArgumentException
name
- the Claim's name.value
- the Claim's value.java.lang.IllegalArgumentException
- if the name is null.Verification withClaim(java.lang.String name, java.lang.Double value) throws java.lang.IllegalArgumentException
name
- the Claim's name.value
- the Claim's value.java.lang.IllegalArgumentException
- if the name is null.Verification withClaim(java.lang.String name, java.lang.String value) throws java.lang.IllegalArgumentException
name
- the Claim's name.value
- the Claim's value.java.lang.IllegalArgumentException
- if the name is null.Verification withClaim(java.lang.String name, java.util.Date value) throws java.lang.IllegalArgumentException
name
- the Claim's name.value
- the Claim's value.java.lang.IllegalArgumentException
- if the name is null.Verification withArrayClaim(java.lang.String name, java.lang.String... items) throws java.lang.IllegalArgumentException
name
- the Claim's name.items
- the items the Claim must contain.java.lang.IllegalArgumentException
- if the name is null.Verification withArrayClaim(java.lang.String name, java.lang.Integer... items) throws java.lang.IllegalArgumentException
name
- the Claim's name.items
- the items the Claim must contain.java.lang.IllegalArgumentException
- if the name is null.Verification withArrayClaim(java.lang.String name, java.lang.Long... items) throws java.lang.IllegalArgumentException
name
- the Claim's name.items
- the items the Claim must contain.java.lang.IllegalArgumentException
- if the name is null.Verification ignoreIssuedAt()
JWTVerifier build()