Class IDTokenClaimsVerifier
java.lang.Object
com.nimbusds.openid.connect.sdk.validators.IDTokenClaimsVerifier
- All Implemented Interfaces:
com.nimbusds.jwt.proc.ClockSkewAware,com.nimbusds.jwt.proc.JWTClaimsSetVerifier
@ThreadSafe
public class IDTokenClaimsVerifier
extends Object
implements com.nimbusds.jwt.proc.JWTClaimsSetVerifier, com.nimbusds.jwt.proc.ClockSkewAware
ID token claims verifier.
Related specifications:
- OpenID Connect Core 1.0, section 3.1.3.7 for code flow.
- OpenID Connect Core 1.0, section 3.2.2.11 for implicit flow.
- OpenID Connect Core 1.0, sections 3.3.2.12 and 3.3.3.7 for hybrid flow.
-
Constructor Summary
ConstructorsConstructorDescriptionIDTokenClaimsVerifier(Issuer issuer, ClientID clientID, Nonce nonce, int maxClockSkew) Creates a new ID token claims verifier. -
Method Summary
Modifier and TypeMethodDescriptionReturns the client ID for verifying the ID token audience.Returns the expected ID token issuer.Returns the expected nonce.intvoidsetMaxClockSkew(int maxClockSkew) voidverify(com.nimbusds.jwt.JWTClaimsSet claimsSet, com.nimbusds.jose.proc.SecurityContext ctx)
-
Constructor Details
-
IDTokenClaimsVerifier
Creates a new ID token claims verifier.- Parameters:
issuer- The expected ID token issuer. Must not benull.clientID- The client ID. Must not benull.nonce- The nonce, required in the implicit flow or for ID tokens returned by the authorisation endpoint int the hybrid flow.nullif not required or specified.maxClockSkew- The maximum acceptable clock skew (absolute value), in seconds. Must be zero (no clock skew) or positive integer.
-
-
Method Details
-
getExpectedIssuer
Returns the expected ID token issuer.- Returns:
- The ID token issuer.
-
getClientID
Returns the client ID for verifying the ID token audience.- Returns:
- The client ID.
-
getExpectedNonce
Returns the expected nonce.- Returns:
- The nonce,
nullif not required or specified.
-
getMaxClockSkew
- Specified by:
getMaxClockSkewin interfacecom.nimbusds.jwt.proc.ClockSkewAware
-
setMaxClockSkew
- Specified by:
setMaxClockSkewin interfacecom.nimbusds.jwt.proc.ClockSkewAware
-
verify
public void verify(com.nimbusds.jwt.JWTClaimsSet claimsSet, com.nimbusds.jose.proc.SecurityContext ctx) throws com.nimbusds.jwt.proc.BadJWTException - Specified by:
verifyin interfacecom.nimbusds.jwt.proc.JWTClaimsSetVerifier- Throws:
com.nimbusds.jwt.proc.BadJWTException
-