Class AbstractJWTValidator
java.lang.Object
com.nimbusds.openid.connect.sdk.validators.AbstractJWTValidator
- All Implemented Interfaces:
com.nimbusds.jwt.proc.ClockSkewAware
- Direct Known Subclasses:
IDTokenValidator
,JARMValidator
,LogoutTokenValidator
public abstract class AbstractJWTValidator
extends Object
implements com.nimbusds.jwt.proc.ClockSkewAware
Abstract JSON Web Token (JWT) validator for ID tokens and logout tokens.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The default maximum acceptable clock skew for verifying token timestamps, in seconds. -
Constructor Summary
ConstructorDescriptionAbstractJWTValidator
(com.nimbusds.jose.JOSEObjectType jwtType, Issuer expectedIssuer, ClientID clientID, com.nimbusds.jose.proc.JWSKeySelector jwsKeySelector, com.nimbusds.jose.proc.JWEKeySelector jweKeySelector) Creates a new abstract JWT validator.AbstractJWTValidator
(Issuer expectedIssuer, ClientID clientID, com.nimbusds.jose.proc.JWSKeySelector jwsKeySelector, com.nimbusds.jose.proc.JWEKeySelector jweKeySelector) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionReturns the client ID (the expected JWT audience).Returns the expected token issuer.com.nimbusds.jose.JOSEObjectType
Returns the expected JWT "typ" (type) header.com.nimbusds.jose.proc.JWEKeySelector
Returns the configured JWE key selector for encrypted token decryption.com.nimbusds.jose.proc.JWSKeySelector
Returns the configured JWS key selector for signed token verification.int
Gets the maximum acceptable clock skew for verifying the token timestamps.void
setMaxClockSkew
(int maxClockSkew) Sets the maximum acceptable clock skew for verifying the token timestamps.
-
Field Details
-
DEFAULT_MAX_CLOCK_SKEW
The default maximum acceptable clock skew for verifying token timestamps, in seconds.- See Also:
-
-
Constructor Details
-
AbstractJWTValidator
@Deprecated public AbstractJWTValidator(Issuer expectedIssuer, ClientID clientID, com.nimbusds.jose.proc.JWSKeySelector jwsKeySelector, com.nimbusds.jose.proc.JWEKeySelector jweKeySelector) Deprecated.Creates a new abstract JWT validator.- Parameters:
expectedIssuer
- The expected token issuer (OpenID Provider). Must not benull
.clientID
- The client ID. Must not benull
.jwsKeySelector
- The key selector for JWS verification,null
if unsecured (plain) tokens are expected.jweKeySelector
- The key selector for JWE decryption,null
if encrypted tokens are not expected.
-
AbstractJWTValidator
public AbstractJWTValidator(com.nimbusds.jose.JOSEObjectType jwtType, Issuer expectedIssuer, ClientID clientID, com.nimbusds.jose.proc.JWSKeySelector jwsKeySelector, com.nimbusds.jose.proc.JWEKeySelector jweKeySelector) Creates a new abstract JWT validator.- Parameters:
jwtType
- The expected JWT "typ" (type) header,null
if none.expectedIssuer
- The expected token issuer (OpenID Provider). Must not benull
.clientID
- The client ID. Must not benull
.jwsKeySelector
- The key selector for JWS verification,null
if unsecured (plain) tokens are expected.jweKeySelector
- The key selector for JWE decryption,null
if encrypted tokens are not expected.
-
-
Method Details
-
getExpectedJWTType
Returns the expected JWT "typ" (type) header.- Returns:
- The expected JWT "typ" (type) header,
null
if none.
-
getExpectedIssuer
Returns the expected token issuer.- Returns:
- The token issuer.
-
getClientID
Returns the client ID (the expected JWT audience).- Returns:
- The client ID.
-
getJWSKeySelector
Returns the configured JWS key selector for signed token verification.- Returns:
- The JWS key selector,
null
if none.
-
getJWEKeySelector
Returns the configured JWE key selector for encrypted token decryption.- Returns:
- The JWE key selector,
null
.
-
getMaxClockSkew
Gets the maximum acceptable clock skew for verifying the token timestamps.- Specified by:
getMaxClockSkew
in interfacecom.nimbusds.jwt.proc.ClockSkewAware
- Returns:
- The maximum acceptable clock skew, in seconds. Zero indicates none.
-
setMaxClockSkew
Sets the maximum acceptable clock skew for verifying the token timestamps.- Specified by:
setMaxClockSkew
in interfacecom.nimbusds.jwt.proc.ClockSkewAware
- Parameters:
maxClockSkew
- The maximum acceptable clock skew, in seconds. Zero indicates none. Must not be negative.
-