@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()
ClockSkewAware
getMaxClockSkew
in interface ClockSkewAware
public void setMaxClockSkew(int maxClockSkewSeconds)
ClockSkewAware
setMaxClockSkew
in interface ClockSkewAware
maxClockSkewSeconds
- The maximum acceptable clock skew, in
seconds. Zero if none.public void verify(JWTClaimsSet claimsSet) throws BadJWTException
JWTClaimsVerifier
verify
in interface JWTClaimsVerifier
claimsSet
- The JWT claims set. Not null
.BadJWTException
- If the JWT claims set is rejected.public void verify(JWTClaimsSet claimsSet, C context) throws BadJWTException
JWTClaimsSetVerifier
verify
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 © 2016 Connect2id Ltd.. All rights reserved.