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

## DeviceAuthorizationResponseFormatter Class

Formats device authorization results \(RFC 8628\) as [Microsoft\.AspNetCore\.Http\.IResult](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iresult 'Microsoft\.AspNetCore\.Http\.IResult'): a JSON device\-code response on success, or
the JSON OAuth error on failure\. The verification URIs, code lifetime and polling interval are taken from the
configured device authorization options\.

```csharp
public class DeviceAuthorizationResponseFormatter : Abblix.Oidc.Server.MinimalApi.Formatters.Interfaces.IDeviceAuthorizationResponseFormatter
```

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

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

## DeviceAuthorizationResponseFormatter\(IOptions\<OidcOptions\>\) Constructor {#Abblix.Oidc.Server.MinimalApi.Formatters.DeviceAuthorizationResponseFormatter.DeviceAuthorizationResponseFormatter(Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_)}

Formats device authorization results \(RFC 8628\) as [Microsoft\.AspNetCore\.Http\.IResult](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iresult 'Microsoft\.AspNetCore\.Http\.IResult'): a JSON device\-code response on success, or
the JSON OAuth error on failure\. The verification URIs, code lifetime and polling interval are taken from the
configured device authorization options\.

```csharp
public DeviceAuthorizationResponseFormatter(Microsoft.Extensions.Options.IOptions<Abblix.Oidc.Server.Common.Configuration.OidcOptions> options);
```
#### 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.MinimalApi.Formatters.DeviceAuthorizationResponseFormatter.DeviceAuthorizationResponseFormatter(Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_).options}

Configuration options containing device authorization settings\.
### Methods

## DeviceAuthorizationResponseFormatter\.FormatResponseAsync\(DeviceAuthorizationRequest, Result\<DeviceAuthorizationResponse,OidcError\>\) Method {#Abblix.Oidc.Server.MinimalApi.Formatters.DeviceAuthorizationResponseFormatter.FormatResponseAsync(Abblix.Oidc.Server.Model.DeviceAuthorizationRequest,Abblix.Utils.Result_Abblix.Oidc.Server.Model.DeviceAuthorizationResponse,Abblix.Oidc.Server.Common.OidcError_)}

Formats the device authorization endpoint result\.

```csharp
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Http.IResult> FormatResponseAsync(Abblix.Oidc.Server.Model.DeviceAuthorizationRequest request, Abblix.Utils.Result<Abblix.Oidc.Server.Model.DeviceAuthorizationResponse,Abblix.Oidc.Server.Common.OidcError> response);
```
#### Parameters

###### `request` [DeviceAuthorizationRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Model.DeviceAuthorizationRequest 'Abblix\.Oidc\.Server\.Model\.DeviceAuthorizationRequest') {#Abblix.Oidc.Server.MinimalApi.Formatters.DeviceAuthorizationResponseFormatter.FormatResponseAsync(Abblix.Oidc.Server.Model.DeviceAuthorizationRequest,Abblix.Utils.Result_Abblix.Oidc.Server.Model.DeviceAuthorizationResponse,Abblix.Oidc.Server.Common.OidcError_).request}

The core device authorization 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')[DeviceAuthorizationResponse](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Model.DeviceAuthorizationResponse 'Abblix\.Oidc\.Server\.Model\.DeviceAuthorizationResponse')[,](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.DeviceAuthorizationResponseFormatter.FormatResponseAsync(Abblix.Oidc.Server.Model.DeviceAuthorizationRequest,Abblix.Utils.Result_Abblix.Oidc.Server.Model.DeviceAuthorizationResponse,Abblix.Oidc.Server.Common.OidcError_).response}

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

Implements [FormatResponseAsync\(DeviceAuthorizationRequest, Result&lt;DeviceAuthorizationResponse,OidcError&gt;\)](https://www.abblix.com/en/docs/api/abblix-oidc-server-minimalapi/Abblix.Oidc.Server.MinimalApi.Formatters.Interfaces.IDeviceAuthorizationResponseFormatter#Abblix.Oidc.Server.MinimalApi.Formatters.Interfaces.IDeviceAuthorizationResponseFormatter.FormatResponseAsync(Abblix.Oidc.Server.Model.DeviceAuthorizationRequest,Abblix.Utils.Result_Abblix.Oidc.Server.Model.DeviceAuthorizationResponse,Abblix.Oidc.Server.Common.OidcError_) 'Abblix\.Oidc\.Server\.MinimalApi\.Formatters\.Interfaces\.IDeviceAuthorizationResponseFormatter\.FormatResponseAsync\(Abblix\.Oidc\.Server\.Model\.DeviceAuthorizationRequest, Abblix\.Utils\.Result\<Abblix\.Oidc\.Server\.Model\.DeviceAuthorizationResponse,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\.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 device\-code response or the formatted error\.
