Class IDTokenClaimsVerifier

  • All Implemented Interfaces:
    com.nimbusds.jwt.proc.ClockSkewAware, com.nimbusds.jwt.proc.JWTClaimsSetVerifier

    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 for code flow.
    • OpenID Connect Core 1.0, section for implicit flow.
    • OpenID Connect Core 1.0, sections and for hybrid flow.
    • Constructor Detail

      • IDTokenClaimsVerifier

        public IDTokenClaimsVerifier​(Issuer issuer,
                                     ClientID clientID,
                                     Nonce nonce,
                                     int maxClockSkew)
        Creates a new ID token claims verifier.
        issuer - The expected ID token issuer. Must not be null.
        clientID - The client ID. Must not be null.
        nonce - The nonce, required in the implicit flow or for ID tokens returned by the authorisation endpoint int the hybrid flow. null if not required or specified.
        maxClockSkew - The maximum acceptable clock skew (absolute value), in seconds. Must be zero (no clock skew) or positive integer.
    • Method Detail

      • getExpectedIssuer

        public Issuer getExpectedIssuer()
        Returns the expected ID token issuer.
        The ID token issuer.
      • getClientID

        public ClientID getClientID()
        Returns the client ID for verifying the ID token audience.
        The client ID.
      • getExpectedNonce

        public Nonce getExpectedNonce()
        Returns the expected nonce.
        The nonce, null if not required or specified.
      • getMaxClockSkew

        public int getMaxClockSkew()
        Specified by:
        getMaxClockSkew in interface com.nimbusds.jwt.proc.ClockSkewAware
      • setMaxClockSkew

        public void setMaxClockSkew​(int maxClockSkew)
        Specified by:
        setMaxClockSkew in interface com.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:
        verify in interface com.nimbusds.jwt.proc.JWTClaimsSetVerifier