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

## TokenResponseFormatter Class

Formatter for token responses\.

```csharp
public class TokenResponseFormatter : Abblix.Oidc.Server.Mvc.Formatters.Interfaces.ITokenResponseFormatter
```

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

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

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

Formatter for token responses\.

```csharp
public TokenResponseFormatter(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.TokenResponseFormatter.TokenResponseFormatter(Abblix.Oidc.Server.Features.Issuer.IIssuerProvider).issuerProvider}

Supplies the issuer identifier used as the realm value on
            `WWW-Authenticate` challenges for client\-authentication failures\.
### Methods

## TokenResponseFormatter\.FormatResponseAsync\(TokenRequest, Result\<TokenIssued,OidcError\>\) Method {#Abblix.Oidc.Server.Mvc.Formatters.TokenResponseFormatter.FormatResponseAsync(Abblix.Oidc.Server.Model.TokenRequest,Abblix.Utils.Result_Abblix.Oidc.Server.Endpoints.Token.Interfaces.TokenIssued,Abblix.Oidc.Server.Common.OidcError_)}

Asynchronously formats the response for a token request\.

```csharp
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult<Abblix.Oidc.Server.Model.TokenResponse>> FormatResponseAsync(Abblix.Oidc.Server.Model.TokenRequest request, Abblix.Utils.Result<Abblix.Oidc.Server.Endpoints.Token.Interfaces.TokenIssued,Abblix.Oidc.Server.Common.OidcError> response);
```
#### Parameters

###### `request` [TokenRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Model.TokenRequest 'Abblix\.Oidc\.Server\.Model\.TokenRequest') {#Abblix.Oidc.Server.Mvc.Formatters.TokenResponseFormatter.FormatResponseAsync(Abblix.Oidc.Server.Model.TokenRequest,Abblix.Utils.Result_Abblix.Oidc.Server.Endpoints.Token.Interfaces.TokenIssued,Abblix.Oidc.Server.Common.OidcError_).request}

The token request\.

###### `response` [Abblix\.Utils\.Result&lt;](https://www.abblix.com/en/docs/api/abblix-utils/Abblix.Utils.Result_TSuccess_TFailure_ 'Abblix\.Utils\.Result\`2')[TokenIssued](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Token.Interfaces.TokenIssued 'Abblix\.Oidc\.Server\.Endpoints\.Token\.Interfaces\.TokenIssued')[,](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.TokenResponseFormatter.FormatResponseAsync(Abblix.Oidc.Server.Model.TokenRequest,Abblix.Utils.Result_Abblix.Oidc.Server.Endpoints.Token.Interfaces.TokenIssued,Abblix.Oidc.Server.Common.OidcError_).response}

The response from the token endpoint\.

Implements [FormatResponseAsync\(TokenRequest, Result&lt;TokenIssued,OidcError&gt;\)](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc/Abblix.Oidc.Server.Mvc.Formatters.Interfaces.ITokenResponseFormatter#Abblix.Oidc.Server.Mvc.Formatters.Interfaces.ITokenResponseFormatter.FormatResponseAsync(Abblix.Oidc.Server.Model.TokenRequest,Abblix.Utils.Result_Abblix.Oidc.Server.Endpoints.Token.Interfaces.TokenIssued,Abblix.Oidc.Server.Common.OidcError_) 'Abblix\.Oidc\.Server\.Mvc\.Formatters\.Interfaces\.ITokenResponseFormatter\.FormatResponseAsync\(Abblix\.Oidc\.Server\.Model\.TokenRequest, Abblix\.Utils\.Result\<Abblix\.Oidc\.Server\.Endpoints\.Token\.Interfaces\.TokenIssued,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&lt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.actionresult-1 'Microsoft\.AspNetCore\.Mvc\.ActionResult\`1')[TokenResponse](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Model.TokenResponse 'Abblix\.Oidc\.Server\.Model\.TokenResponse')[&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 returns the formatted token response\.
