#### [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')

## BackChannelAuthenticationResponseFormatter Class

Handles the formatting of responses for back\-channel authentication requests\.
This class ensures that the appropriate HTTP responses are generated based on the type of back\-channel
authentication response, encapsulating success or error scenarios as defined by OAuth 2\.0 standards\.

```csharp
public class BackChannelAuthenticationResponseFormatter : Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IBackChannelAuthenticationResponseFormatter
```

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

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

## BackChannelAuthenticationResponseFormatter\(IIssuerProvider\) Constructor {#Abblix.Oidc.Server.Mvc.Formatters.BackChannelAuthenticationResponseFormatter.BackChannelAuthenticationResponseFormatter(Abblix.Oidc.Server.Features.Issuer.IIssuerProvider)}

Handles the formatting of responses for back\-channel authentication requests\.
This class ensures that the appropriate HTTP responses are generated based on the type of back\-channel
authentication response, encapsulating success or error scenarios as defined by OAuth 2\.0 standards\.

```csharp
public BackChannelAuthenticationResponseFormatter(Abblix.Oidc.Server.Features.Issuer.IIssuerProvider issuerProvider);
```
#### Parameters

###### `issuerProvider` [IIssuerProvider](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Issuer.IIssuerProvider 'Abblix\.Oidc\.Server\.Features\.Issuer\.IIssuerProvider') {#Abblix.Oidc.Server.Mvc.Formatters.BackChannelAuthenticationResponseFormatter.BackChannelAuthenticationResponseFormatter(Abblix.Oidc.Server.Features.Issuer.IIssuerProvider).issuerProvider}
### Methods

## BackChannelAuthenticationResponseFormatter\.FormatResponseAsync\(BackChannelAuthenticationRequest, ClientRequest, Result\<BackChannelAuthenticationSuccess,OidcError\>\) Method {#Abblix.Oidc.Server.Mvc.Formatters.BackChannelAuthenticationResponseFormatter.FormatResponseAsync(Abblix.Oidc.Server.Model.BackChannelAuthenticationRequest,Abblix.Oidc.Server.Model.ClientRequest,Abblix.Utils.Result_Abblix.Oidc.Server.Model.BackChannelAuthenticationSuccess,Abblix.Oidc.Server.Common.OidcError_)}

This method transforms the back\-channel authentication response into a suitable HTTP response,
ensuring that different outcomes \(success or various types of errors\) are appropriately represented
as HTTP status codes and payloads\.

```csharp
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult> FormatResponseAsync(Abblix.Oidc.Server.Model.BackChannelAuthenticationRequest request, Abblix.Oidc.Server.Model.ClientRequest clientRequest, Abblix.Utils.Result<Abblix.Oidc.Server.Model.BackChannelAuthenticationSuccess,Abblix.Oidc.Server.Common.OidcError> response);
```
#### Parameters

###### `request` [BackChannelAuthenticationRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Model.BackChannelAuthenticationRequest 'Abblix\.Oidc\.Server\.Model\.BackChannelAuthenticationRequest') {#Abblix.Oidc.Server.Mvc.Formatters.BackChannelAuthenticationResponseFormatter.FormatResponseAsync(Abblix.Oidc.Server.Model.BackChannelAuthenticationRequest,Abblix.Oidc.Server.Model.ClientRequest,Abblix.Utils.Result_Abblix.Oidc.Server.Model.BackChannelAuthenticationSuccess,Abblix.Oidc.Server.Common.OidcError_).request}

The original back\-channel authentication request that triggered the response\.

###### `clientRequest` [ClientRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Model.ClientRequest 'Abblix\.Oidc\.Server\.Model\.ClientRequest') {#Abblix.Oidc.Server.Mvc.Formatters.BackChannelAuthenticationResponseFormatter.FormatResponseAsync(Abblix.Oidc.Server.Model.BackChannelAuthenticationRequest,Abblix.Oidc.Server.Model.ClientRequest,Abblix.Utils.Result_Abblix.Oidc.Server.Model.BackChannelAuthenticationSuccess,Abblix.Oidc.Server.Common.OidcError_).clientRequest}

The client request containing authentication details\.

###### `response` [Abblix\.Utils\.Result&lt;](https://www.abblix.com/en/docs/api/abblix-utils/Abblix.Utils.Result_TSuccess_TFailure_ 'Abblix\.Utils\.Result\`2')[BackChannelAuthenticationSuccess](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Model.BackChannelAuthenticationSuccess 'Abblix\.Oidc\.Server\.Model\.BackChannelAuthenticationSuccess')[,](https://www.abblix.com/en/docs/api/abblix-utils/Abblix.Utils.Result_TSuccess_TFailure_ 'Abblix\.Utils\.Result\`2')[OidcError](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.OidcError 'Abblix\.Oidc\.Server\.Common\.OidcError')[&gt;](https://www.abblix.com/en/docs/api/abblix-utils/Abblix.Utils.Result_TSuccess_TFailure_ 'Abblix\.Utils\.Result\`2') {#Abblix.Oidc.Server.Mvc.Formatters.BackChannelAuthenticationResponseFormatter.FormatResponseAsync(Abblix.Oidc.Server.Model.BackChannelAuthenticationRequest,Abblix.Oidc.Server.Model.ClientRequest,Abblix.Utils.Result_Abblix.Oidc.Server.Model.BackChannelAuthenticationSuccess,Abblix.Oidc.Server.Common.OidcError_).response}

The back\-channel authentication response result that needs to be formatted into an HTTP result\.

Implements [FormatResponseAsync\(BackChannelAuthenticationRequest, ClientRequest, Result&lt;BackChannelAuthenticationSuccess,OidcError&gt;\)](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc/Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IBackChannelAuthenticationResponseFormatter#Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IBackChannelAuthenticationResponseFormatter.FormatResponseAsync(Abblix.Oidc.Server.Model.BackChannelAuthenticationRequest,Abblix.Oidc.Server.Model.ClientRequest,Abblix.Utils.Result_Abblix.Oidc.Server.Model.BackChannelAuthenticationSuccess,Abblix.Oidc.Server.Common.OidcError_) 'Abblix\.Oidc\.Server\.Mvc\.Formatters\.Interfaces\.IBackChannelAuthenticationResponseFormatter\.FormatResponseAsync\(Abblix\.Oidc\.Server\.Model\.BackChannelAuthenticationRequest, Abblix\.Oidc\.Server\.Model\.ClientRequest, Abblix\.Utils\.Result\<Abblix\.Oidc\.Server\.Model\.BackChannelAuthenticationSuccess,Abblix\.Oidc\.Server\.Common\.OidcError\>\)')

#### 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 [System\.Threading\.Tasks\.Task](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task 'System\.Threading\.Tasks\.Task') representing the asynchronous operation,
            with the formatted response as an [Microsoft\.AspNetCore\.Mvc\.ActionResult](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.actionresult 'Microsoft\.AspNetCore\.Mvc\.ActionResult')\.

### Remarks
This method formats successful authentication requests as `200 OK`,
client\-related errors as `401 Unauthorized` or `403 Forbidden`,
and general errors as `400 Bad Request`\.
Per RFC 9110 Section 11\.6\.1, all `401` responses include a `WWW-Authenticate` header
matching the client's authentication scheme per RFC 6749 Section 5\.2\.
