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

## AuthorizationResponseFormatter Class

Handles the formatting of authorization responses in compliance with OpenID Connect and OAuth 2\.0 protocols\.
Protocol\-level decisions \(parameter assembly, iss/scope gating, JARM packing\) are made upstream by the core
response encoder; this formatter maps the encoded response onto the MVC wire DTO and delivers it to the
client's redirect URI via query, fragment or form\_post \- for both successful and error responses\.

```csharp
public class AuthorizationResponseFormatter : Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IAuthorizationResponseFormatter
```

Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → AuthorizationResponseFormatter

Implements [IAuthorizationResponseFormatter](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc/Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IAuthorizationResponseFormatter 'Abblix\.Oidc\.Server\.Mvc\.Formatters\.Interfaces\.IAuthorizationResponseFormatter')
### Constructors

## AuthorizationResponseFormatter\(IOptions\<OidcOptions\>, IAuthorizationRequestStorage, ISessionManagementService, IUriResolver, IParametersProvider\) Constructor {#Abblix.Oidc.Server.Mvc.Formatters.AuthorizationResponseFormatter.AuthorizationResponseFormatter(Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_,Abblix.Oidc.Server.Features.Storages.IAuthorizationRequestStorage,Abblix.Oidc.Server.Features.SessionManagement.ISessionManagementService,Abblix.Oidc.Server.Mvc.IUriResolver,Abblix.Oidc.Server.Common.Interfaces.IParametersProvider)}

Handles the formatting of authorization responses in compliance with OpenID Connect and OAuth 2\.0 protocols\.
Protocol\-level decisions \(parameter assembly, iss/scope gating, JARM packing\) are made upstream by the core
response encoder; this formatter maps the encoded response onto the MVC wire DTO and delivers it to the
client's redirect URI via query, fragment or form\_post \- for both successful and error responses\.

```csharp
public AuthorizationResponseFormatter(Microsoft.Extensions.Options.IOptions<Abblix.Oidc.Server.Common.Configuration.OidcOptions> options, Abblix.Oidc.Server.Features.Storages.IAuthorizationRequestStorage authorizationRequestStorage, Abblix.Oidc.Server.Features.SessionManagement.ISessionManagementService sessionManagementService, Abblix.Oidc.Server.Mvc.IUriResolver uriResolver, Abblix.Oidc.Server.Common.Interfaces.IParametersProvider parametersProvider);
```
#### Parameters

###### `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.Formatters.AuthorizationResponseFormatter.AuthorizationResponseFormatter(Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_,Abblix.Oidc.Server.Features.Storages.IAuthorizationRequestStorage,Abblix.Oidc.Server.Features.SessionManagement.ISessionManagementService,Abblix.Oidc.Server.Mvc.IUriResolver,Abblix.Oidc.Server.Common.Interfaces.IParametersProvider).options}

Provides the configured interaction URIs \(login, consent, \.\.\.\) and request\-uri
            parameter name used when redirecting the user agent to the authorization server's own UI\.

###### `authorizationRequestStorage` [IAuthorizationRequestStorage](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Storages.IAuthorizationRequestStorage 'Abblix\.Oidc\.Server\.Features\.Storages\.IAuthorizationRequestStorage') {#Abblix.Oidc.Server.Mvc.Formatters.AuthorizationResponseFormatter.AuthorizationResponseFormatter(Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_,Abblix.Oidc.Server.Features.Storages.IAuthorizationRequestStorage,Abblix.Oidc.Server.Features.SessionManagement.ISessionManagementService,Abblix.Oidc.Server.Mvc.IUriResolver,Abblix.Oidc.Server.Common.Interfaces.IParametersProvider).authorizationRequestStorage}

Stores the pending authorization request when redirecting to an
            interaction page, returning the request\_uri that links back to it\.

###### `sessionManagementService` [ISessionManagementService](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.SessionManagement.ISessionManagementService 'Abblix\.Oidc\.Server\.Features\.SessionManagement\.ISessionManagementService') {#Abblix.Oidc.Server.Mvc.Formatters.AuthorizationResponseFormatter.AuthorizationResponseFormatter(Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_,Abblix.Oidc.Server.Features.Storages.IAuthorizationRequestStorage,Abblix.Oidc.Server.Features.SessionManagement.ISessionManagementService,Abblix.Oidc.Server.Mvc.IUriResolver,Abblix.Oidc.Server.Common.Interfaces.IParametersProvider).sessionManagementService}

Supplies the OIDC Session Management cookie appended to a successful
            authentication response\.

###### `uriResolver` [IUriResolver](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc/Abblix.Oidc.Server.Mvc.IUriResolver 'Abblix\.Oidc\.Server\.Mvc\.IUriResolver') {#Abblix.Oidc.Server.Mvc.Formatters.AuthorizationResponseFormatter.AuthorizationResponseFormatter(Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_,Abblix.Oidc.Server.Features.Storages.IAuthorizationRequestStorage,Abblix.Oidc.Server.Features.SessionManagement.ISessionManagementService,Abblix.Oidc.Server.Mvc.IUriResolver,Abblix.Oidc.Server.Common.Interfaces.IParametersProvider).uriResolver}

Resolves relative interaction URIs to absolute ones for redirection\.

###### `parametersProvider` [IParametersProvider](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Interfaces.IParametersProvider 'Abblix\.Oidc\.Server\.Common\.Interfaces\.IParametersProvider') {#Abblix.Oidc.Server.Mvc.Formatters.AuthorizationResponseFormatter.AuthorizationResponseFormatter(Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_,Abblix.Oidc.Server.Features.Storages.IAuthorizationRequestStorage,Abblix.Oidc.Server.Features.SessionManagement.ISessionManagementService,Abblix.Oidc.Server.Mvc.IUriResolver,Abblix.Oidc.Server.Common.Interfaces.IParametersProvider).parametersProvider}

Flattens the MVC wire DTO into name/value pairs for delivery\.
### Methods

## AuthorizationResponseFormatter\.FormatResponseAsync\(AuthorizationRequest, AuthorizationResponse\) Method {#Abblix.Oidc.Server.Mvc.Formatters.AuthorizationResponseFormatter.FormatResponseAsync(Abblix.Oidc.Server.Model.AuthorizationRequest,Abblix.Oidc.Server.Endpoints.Authorization.Interfaces.AuthorizationResponse)}

Formats an authorization response based on the specified request and response model asynchronously\.
It handles various outcomes such as redirections for additional user interactions and successful authentication,
adapting the response according to the OpenID Connect and OAuth 2\.0 specifications\.

```csharp
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult> FormatResponseAsync(Abblix.Oidc.Server.Model.AuthorizationRequest request, Abblix.Oidc.Server.Endpoints.Authorization.Interfaces.AuthorizationResponse response);
```
#### Parameters

###### `request` [AuthorizationRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Model.AuthorizationRequest 'Abblix\.Oidc\.Server\.Model\.AuthorizationRequest') {#Abblix.Oidc.Server.Mvc.Formatters.AuthorizationResponseFormatter.FormatResponseAsync(Abblix.Oidc.Server.Model.AuthorizationRequest,Abblix.Oidc.Server.Endpoints.Authorization.Interfaces.AuthorizationResponse).request}

The authorization request containing details about the initial request from the client\.

###### `response` [AuthorizationResponse](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Authorization.Interfaces.AuthorizationResponse 'Abblix\.Oidc\.Server\.Endpoints\.Authorization\.Interfaces\.AuthorizationResponse') {#Abblix.Oidc.Server.Mvc.Formatters.AuthorizationResponseFormatter.FormatResponseAsync(Abblix.Oidc.Server.Model.AuthorizationRequest,Abblix.Oidc.Server.Endpoints.Authorization.Interfaces.AuthorizationResponse).response}

The authorization response model to format\.

Implements [FormatResponseAsync\(AuthorizationRequest, AuthorizationResponse\)](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc/Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IAuthorizationResponseFormatter#Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IAuthorizationResponseFormatter.FormatResponseAsync(Abblix.Oidc.Server.Model.AuthorizationRequest,Abblix.Oidc.Server.Endpoints.Authorization.Interfaces.AuthorizationResponse) 'Abblix\.Oidc\.Server\.Mvc\.Formatters\.Interfaces\.IAuthorizationResponseFormatter\.FormatResponseAsync\(Abblix\.Oidc\.Server\.Model\.AuthorizationRequest, Abblix\.Oidc\.Server\.Endpoints\.Authorization\.Interfaces\.AuthorizationResponse\)')

#### 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](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.actionresult 'Microsoft\.AspNetCore\.Mvc\.ActionResult')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
A task that returns an [Microsoft\.AspNetCore\.Mvc\.ActionResult](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.actionresult 'Microsoft\.AspNetCore\.Mvc\.ActionResult')
            that can be returned by an ASP\.NET Core controller\.
