Class ClientAuthenticationVerifier<T>


  • @ThreadSafe
    public class ClientAuthenticationVerifier<T>
    extends Object
    Client authentication verifier.

    Related specifications:

    • OAuth 2.0 (RFC 6749), sections 2.3.1 and 3.2.1.
    • OpenID Connect Core 1.0, section 9.
    • JSON Web Token (JWT) Profile for OAuth 2.0 Client Authentication and Authorization Grants (RFC 7523).
    • OAuth 2.0 Mutual TLS Client Authentication and Certificate Bound Access Tokens (draft-ietf-oauth-mtls-12), section 2.
    • Constructor Detail

      • ClientAuthenticationVerifier

        public ClientAuthenticationVerifier​(ClientCredentialsSelector<T> clientCredentialsSelector,
                                            ClientX509CertificateBindingVerifier<T> certBindingVerifier,
                                            Set<Audience> expectedAudience)
        Creates a new client authentication verifier.
        Parameters:
        clientCredentialsSelector - The client credentials selector. Must not be null.
        certBindingVerifier - Optional client X.509 certificate binding verifier for tls_client_auth, null if not supported.
        expectedAudience - The permitted audience (aud) claim values in JWT authentication assertions. Must not be empty or null. Should typically contain the token endpoint URI and for OpenID provider it may also include the issuer URI.
    • Method Detail

      • getExpectedAudience

        public Set<AudiencegetExpectedAudience()
        Returns the permitted audience values in JWT authentication assertions.
        Returns:
        The permitted audience (aud) claim values.
      • verify

        public void verify​(ClientAuthentication clientAuth,
                           Set<Hint> hints,
                           Context<T> context)
                    throws InvalidClientException,
                           com.nimbusds.jose.JOSEException
        Verifies a client authentication request.
        Parameters:
        clientAuth - The client authentication. Must not be null.
        hints - Optional hints to the verifier, empty set of null if none.
        context - Additional context to be passed to the client credentials selector. May be null.
        Throws:
        InvalidClientException - If the client authentication is invalid, typically due to bad credentials.
        com.nimbusds.jose.JOSEException - If authentication failed due to an internal JOSE / JWT processing exception.