@ThreadSafe public class DefaultJWTClaimsVerifier<C extends SecurityContext> extends Object implements JWTClaimsSetVerifier<C>, JWTClaimsVerifier, ClockSkewAware
Performs the following checks:
This class may be extended to perform additional checks.
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAX_CLOCK_SKEW_SECONDS
The default maximum acceptable clock skew, in seconds (60).
|
| Constructor and Description |
|---|
DefaultJWTClaimsVerifier() |
| Modifier and Type | Method and Description |
|---|---|
int |
getMaxClockSkew()
Gets the maximum acceptable clock skew.
|
void |
setMaxClockSkew(int maxClockSkewSeconds)
Sets the maximum acceptable clock skew.
|
void |
verify(JWTClaimsSet claimsSet)
Performs verification of selected or all claims in the specified JWT
claims set.
|
void |
verify(JWTClaimsSet claimsSet,
C context)
Verifies selected or all claims from the specified JWT claims set.
|
public static final int DEFAULT_MAX_CLOCK_SKEW_SECONDS
public DefaultJWTClaimsVerifier()
public int getMaxClockSkew()
ClockSkewAwaregetMaxClockSkew in interface ClockSkewAwarepublic void setMaxClockSkew(int maxClockSkewSeconds)
ClockSkewAwaresetMaxClockSkew in interface ClockSkewAwaremaxClockSkewSeconds - The maximum acceptable clock skew, in
seconds. Zero if none.public void verify(JWTClaimsSet claimsSet) throws BadJWTException
JWTClaimsVerifierverify in interface JWTClaimsVerifierclaimsSet - The JWT claims set. Not null.BadJWTException - If the JWT claims set is rejected.public void verify(JWTClaimsSet claimsSet, C context) throws BadJWTException
JWTClaimsSetVerifierverify in interface JWTClaimsSetVerifier<C extends SecurityContext>claimsSet - The JWT claims set. Not null.context - Optional context, null if not required.BadJWTException - If the JWT claims set is rejected.Copyright © 2018 Connect2id Ltd.. All rights reserved.