Class IdTokenValidatorAdapter

java.lang.Object
org.apache.juneau.rest.server.auth.oidc.rp.IdTokenValidatorAdapter

public class IdTokenValidatorAdapter extends Object
Wraps Nimbus's IDTokenValidator to validate an OpenID Connect ID token's signature and claims and project the verified claims onto a Juneau ClaimsPrincipal.

Nimbus's IDTokenValidator performs the full OIDC ID-token validation in one call: signature verification against the IdP JWKS, exact iss match, aud contains the client id, azp when there are multiple audiences, exp (with clock skew), required iat, and — when supplied — nonce match. This adapter owns only the configuration and the projection to ClaimsPrincipal; no bespoke crypto.

The signing-algorithm allowlist defaults to [RS256, ES256] (both SHA-256 based). The unsafe "none" algorithm is permanently rejected (a token signed with none has no key and so fails the key selector), and SHA-1-family algorithms are excluded by virtue of not being on the allowlist — consistent with the juneau-rest-server-auth-jwt strict-default stance.

For production, configure IdTokenValidatorAdapter.Builder.jwksUri(URI) (Nimbus builds a cached remote key source). For tests / HSM-backed signers / multi-issuer setups, inject a IdTokenValidatorAdapter.Builder.jwkSet(JWKSet) or IdTokenValidatorAdapter.Builder.jwkSource(JWKSource) directly.

Since:
10.0.0