Skip to content

DiscoveryController Class

The DiscoveryController handles requests for OpenID Connect Discovery, providing information about the OpenID Provider's configuration. It supports endpoints for retrieving the provider's metadata and its public key information.

C#
public sealed class DiscoveryController : Microsoft.AspNetCore.Mvc.ControllerBase

Inheritance System.ObjectMicrosoft.AspNetCore.Mvc.ControllerBase → DiscoveryController

Remarks

This controller implements the functionality described in the OpenID Connect Discovery 1.0 specification, which enables clients to discover essential information about the OpenID Provider, such as its authorization and token endpoints, supported scopes, response types, and more.

This facilitates clients in dynamically configuring themselves to communicate with the OpenID Provider. For more details, refer to the OpenID Connect Discovery specification: https://openid.net/specs/openid-connect-discovery-1_0.html.

Methods

DiscoveryController.ConfigurationAsync(IConfigurationHandler, IConfigurationResponseFormatter) Method

Handles the request for the OpenID Provider Configuration Information. This endpoint returns crucial information about the OpenID Connect provider, such as the issuer, key discovery URIs, supported scopes, response types, and more, facilitating dynamic client configuration for OpenID Connect compliance.

C#
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult<Abblix.Oidc.Server.Model.ConfigurationResponse>> ConfigurationAsync(Abblix.Oidc.Server.Endpoints.Configuration.Interfaces.IConfigurationHandler handler, Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IConfigurationResponseFormatter formatter);

Parameters

handler IConfigurationHandler

The service responsible for building discovery metadata.

formatter IConfigurationResponseFormatter

The service responsible for enriching the response with endpoint URLs.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult<ConfigurationResponse>>
A task that results in an action result containing the provider's configuration details in JSON format.

Remarks

The response adheres to the OpenID Connect Discovery specification, providing a standardized set of information necessary for clients to interact with the provider.

DiscoveryController.KeysAsync(IAuthServiceKeysProvider, IOptions<OidcOptions>, ILogger<IAuthServiceKeysProvider>) Method

Provides the public key information used by the OpenID Provider to sign tokens. This endpoint returns a JSON Web Key Set (JWKS) containing the public keys used by the provider. Clients can use these keys to verify the authenticity of identity tokens and access tokens issued by the provider.

C#
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult<Abblix.Jwt.JsonWebKeySet>> KeysAsync(Abblix.Oidc.Server.Common.Interfaces.IAuthServiceKeysProvider serviceKeysProvider, Microsoft.Extensions.Options.IOptions<Abblix.Oidc.Server.Common.Configuration.OidcOptions> options, Microsoft.Extensions.Logging.ILogger<Abblix.Oidc.Server.Common.Interfaces.IAuthServiceKeysProvider> logger);

Parameters

serviceKeysProvider IAuthServiceKeysProvider

Provider for retrieving the service's public key information.

options Microsoft.Extensions.Options.IOptions<OidcOptions>

OIDC options; supplies the key-rollover propagation window used as the JWKS cache lifetime.

logger Microsoft.Extensions.Logging.ILogger<IAuthServiceKeysProvider>

Logger used to warn if a key still carrying private material is stripped before publication.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult<JsonWebKeySet>>
A JSON Web Key Set (JWKS) response in the form of JsonWebKeySet if the Keys endpoint is enabled, containing the public keys used by the provider. The response conforms to the application/json media type. If the Keys endpoint is disabled, a 404 Not Found response is returned.