Class OidcDiscoveryClient
java.lang.Object
org.apache.juneau.rest.auth.oauth.oidc.OidcDiscoveryClient
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
- Since:
- 10.0.0
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic OidcDiscoveryClient.Buildercreate()Static creator.discover()Fetches the authorization server's metadata, trying RFC 8414 first then OIDC Discovery.Returns the configured issuer URL.
-
Constructor Details
-
OidcDiscoveryClient
Constructor.- Parameters:
b- The builder.
-
-
Method Details
-
create
Static creator.- Returns:
- A new builder.
-
getIssuer
Returns the configured issuer URL.- Returns:
- The issuer URL.
-
discover
Fetches the authorization server's metadata, trying RFC 8414 first then OIDC Discovery.- Returns:
- The parsed metadata record.
- Throws:
IOException- If both discovery HTTP fetches fail.OidcDiscoveryException- If the metadata cannot be parsed or the issuer identity check fails.
-