#### [Abblix\.Oidc\.Server\.Mvc](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc 'index')
### [Abblix\.Oidc\.Server\.Mvc\.Controllers](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc/Abblix.Oidc.Server.Mvc.Controllers 'Abblix\.Oidc\.Server\.Mvc\.Controllers')

## 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\.

```csharp
public sealed class DiscoveryController : Microsoft.AspNetCore.Mvc.ControllerBase
```

Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → [Microsoft\.AspNetCore\.Mvc\.ControllerBase](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.controllerbase 'Microsoft\.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](https://openid.net/specs/openid-connect-discovery-1_0.html 'https://openid.net/specs/openid-connect-discovery-1\_0.html')\.
### Methods

## DiscoveryController\.ConfigurationAsync\(IConfigurationHandler, IConfigurationResponseFormatter\) Method {#Abblix.Oidc.Server.Mvc.Controllers.DiscoveryController.ConfigurationAsync(Abblix.Oidc.Server.Endpoints.Configuration.Interfaces.IConfigurationHandler,Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IConfigurationResponseFormatter)}

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\.

```csharp
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](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Configuration.Interfaces.IConfigurationHandler 'Abblix\.Oidc\.Server\.Endpoints\.Configuration\.Interfaces\.IConfigurationHandler') {#Abblix.Oidc.Server.Mvc.Controllers.DiscoveryController.ConfigurationAsync(Abblix.Oidc.Server.Endpoints.Configuration.Interfaces.IConfigurationHandler,Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IConfigurationResponseFormatter).handler}

The service responsible for building discovery metadata\.

###### `formatter` [IConfigurationResponseFormatter](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc/Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IConfigurationResponseFormatter 'Abblix\.Oidc\.Server\.Mvc\.Formatters\.Interfaces\.IConfigurationResponseFormatter') {#Abblix.Oidc.Server.Mvc.Controllers.DiscoveryController.ConfigurationAsync(Abblix.Oidc.Server.Endpoints.Configuration.Interfaces.IConfigurationHandler,Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IConfigurationResponseFormatter).formatter}

The service responsible for enriching the response with endpoint URLs\.

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[Microsoft\.AspNetCore\.Mvc\.ActionResult&lt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.actionresult-1 'Microsoft\.AspNetCore\.Mvc\.ActionResult\`1')[ConfigurationResponse](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Model.ConfigurationResponse 'Abblix\.Oidc\.Server\.Model\.ConfigurationResponse')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.actionresult-1 'Microsoft\.AspNetCore\.Mvc\.ActionResult\`1')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
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 {#Abblix.Oidc.Server.Mvc.Controllers.DiscoveryController.KeysAsync(Abblix.Oidc.Server.Common.Interfaces.IAuthServiceKeysProvider,Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_,Microsoft.Extensions.Logging.ILogger_Abblix.Oidc.Server.Common.Interfaces.IAuthServiceKeysProvider_)}

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\.

```csharp
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](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Interfaces.IAuthServiceKeysProvider 'Abblix\.Oidc\.Server\.Common\.Interfaces\.IAuthServiceKeysProvider') {#Abblix.Oidc.Server.Mvc.Controllers.DiscoveryController.KeysAsync(Abblix.Oidc.Server.Common.Interfaces.IAuthServiceKeysProvider,Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_,Microsoft.Extensions.Logging.ILogger_Abblix.Oidc.Server.Common.Interfaces.IAuthServiceKeysProvider_).serviceKeysProvider}

Provider for retrieving the service's public key information\.

###### `options` [Microsoft\.Extensions\.Options\.IOptions&lt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.options.ioptions-1 'Microsoft\.Extensions\.Options\.IOptions\`1')[OidcOptions](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Configuration.OidcOptions 'Abblix\.Oidc\.Server\.Common\.Configuration\.OidcOptions')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.options.ioptions-1 'Microsoft\.Extensions\.Options\.IOptions\`1') {#Abblix.Oidc.Server.Mvc.Controllers.DiscoveryController.KeysAsync(Abblix.Oidc.Server.Common.Interfaces.IAuthServiceKeysProvider,Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_,Microsoft.Extensions.Logging.ILogger_Abblix.Oidc.Server.Common.Interfaces.IAuthServiceKeysProvider_).options}

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

###### `logger` [Microsoft\.Extensions\.Logging\.ILogger&lt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger-1 'Microsoft\.Extensions\.Logging\.ILogger\`1')[IAuthServiceKeysProvider](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Interfaces.IAuthServiceKeysProvider 'Abblix\.Oidc\.Server\.Common\.Interfaces\.IAuthServiceKeysProvider')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger-1 'Microsoft\.Extensions\.Logging\.ILogger\`1') {#Abblix.Oidc.Server.Mvc.Controllers.DiscoveryController.KeysAsync(Abblix.Oidc.Server.Common.Interfaces.IAuthServiceKeysProvider,Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_,Microsoft.Extensions.Logging.ILogger_Abblix.Oidc.Server.Common.Interfaces.IAuthServiceKeysProvider_).logger}

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

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[Microsoft\.AspNetCore\.Mvc\.ActionResult&lt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.actionresult-1 'Microsoft\.AspNetCore\.Mvc\.ActionResult\`1')[JsonWebKeySet](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt.JsonWebKeySet 'Abblix\.Jwt\.JsonWebKeySet')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.actionresult-1 'Microsoft\.AspNetCore\.Mvc\.ActionResult\`1')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
A JSON Web Key Set \(JWKS\) response in the form of [JsonWebKeySet](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt.JsonWebKeySet 'Abblix\.Jwt\.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\.
