Class OidcDiscoveryClient

java.lang.Object
org.apache.juneau.rest.auth.oauth.oidc.OidcDiscoveryClient

public class OidcDiscoveryClient extends Object
Fetches a Juneau-native OidcMetadata record describing an authorization server, supporting both the RFC 8414 OAuth Authorization Server Metadata endpoint (/.well-known/oauth-authorization-server) and the OpenID Connect Discovery endpoint (/.well-known/openid-configuration).

discover() tries AuthorizationServerMetadata.resolve(...) (RFC 8414) first and falls back to OIDCProviderMetadata.resolve(...) (OIDC Discovery); both perform the RFC 8414 / OIDC Discovery issuer identity check (the returned document's issuer must exactly equal the requested issuer). The metadata is fetched on each call to discover(); the result is not cached internally — callers cache themselves if needed.

Usage

var oidc = OidcDiscoveryClient.create() .issuer(URI.create("https://login.example.com/realms/api")) .build() .discover();

Since:
10.0.0