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

## ITokenResponseFormatter Interface

Formats the result of a token request into an [Microsoft\.AspNetCore\.Http\.IResult](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iresult 'Microsoft\.AspNetCore\.Http\.IResult') \(the success token response or the OAuth error\)\.

```csharp
public interface ITokenResponseFormatter
```

Derived  
↳ [TokenResponseFormatter](https://www.abblix.com/en/docs/api/abblix-oidc-server-minimalapi/Abblix.Oidc.Server.MinimalApi.Formatters.TokenResponseFormatter 'Abblix\.Oidc\.Server\.MinimalApi\.Formatters\.TokenResponseFormatter')
### Methods

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

Formats the token endpoint result\.

```csharp
System.Threading.Tasks.Task<Microsoft.AspNetCore.Http.IResult> 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.MinimalApi.Formatters.Interfaces.ITokenResponseFormatter.FormatResponseAsync(Abblix.Oidc.Server.Model.TokenRequest,Abblix.Utils.Result_Abblix.Oidc.Server.Endpoints.Token.Interfaces.TokenIssued,Abblix.Oidc.Server.Common.OidcError_).request}

The core token request being answered\.

###### `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.MinimalApi.Formatters.Interfaces.ITokenResponseFormatter.FormatResponseAsync(Abblix.Oidc.Server.Model.TokenRequest,Abblix.Utils.Result_Abblix.Oidc.Server.Endpoints.Token.Interfaces.TokenIssued,Abblix.Oidc.Server.Common.OidcError_).response}

The success\-or\-error result produced by the token handler\.

#### 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\.Http\.IResult](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iresult 'Microsoft\.AspNetCore\.Http\.IResult')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
An [Microsoft\.AspNetCore\.Http\.IResult](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iresult 'Microsoft\.AspNetCore\.Http\.IResult') carrying the token response or the formatted error\.
