Skip to content

DeviceAuthorizationResponseFormatter Class

Formats device authorization results (RFC 8628) as 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.

C#
public class DeviceAuthorizationResponseFormatter : Abblix.Oidc.Server.MinimalApi.Formatters.Interfaces.IDeviceAuthorizationResponseFormatter

Inheritance System.Object → DeviceAuthorizationResponseFormatter

Implements IDeviceAuthorizationResponseFormatter

Constructors

DeviceAuthorizationResponseFormatter(IOptions<OidcOptions>) Constructor

Formats device authorization results (RFC 8628) as 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.

C#
public DeviceAuthorizationResponseFormatter(Microsoft.Extensions.Options.IOptions<Abblix.Oidc.Server.Common.Configuration.OidcOptions> options);

Parameters

options Microsoft.Extensions.Options.IOptions<OidcOptions>

Configuration options containing device authorization settings.

Methods

DeviceAuthorizationResponseFormatter.FormatResponseAsync(DeviceAuthorizationRequest, Result<DeviceAuthorizationResponse,OidcError>) Method

Formats the device authorization endpoint result.

C#
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

The core device authorization request being answered.

response Abblix.Utils.Result<DeviceAuthorizationResponse,OidcError>

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

Implements FormatResponseAsync(DeviceAuthorizationRequest, Result<DeviceAuthorizationResponse,OidcError>)

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Http.IResult>
An Microsoft.AspNetCore.Http.IResult carrying the device-code response or the formatted error.