Skip to main content

DeviceAuthorizationRequest Class

Abblix.Oidc.Server

Abblix.Oidc.Server.Features.DeviceAuthorization

DeviceAuthorizationRequest Class

Represents a stored device authorization request as defined in RFC 8628. This record is used to persist the state of a device authorization flow between the initial request and when the user completes authentication.

public record DeviceAuthorizationRequest : System.IEquatable<Abblix.Oidc.Server.Features.DeviceAuthorization.DeviceAuthorizationRequest>

Inheritance System.Object → DeviceAuthorizationRequest

Implements System.IEquatable<DeviceAuthorizationRequest>

Constructors

DeviceAuthorizationRequest(string, string[], Uri[], string) Constructor

Represents a stored device authorization request as defined in RFC 8628. This record is used to persist the state of a device authorization flow between the initial request and when the user completes authentication.

public DeviceAuthorizationRequest(string ClientId, string[] Scope, System.Uri[]? Resources, string UserCode);

Parameters

ClientId System.String

The client identifier that initiated the device authorization request.

Scope System.String[]

The requested scopes for the authorization.

Resources System.Uri[]

The requested resources (RFC 8707) for the authorization.

UserCode System.String

The user-friendly code displayed to the user for verification.

Properties

DeviceAuthorizationRequest.AuthorizationDetails Property

RFC 9396 §3 Rich Authorization Requests array carried from the original /device_authorization request. The host's user-verification step reads this (via ValidUserCode) to render structured consent, then threads it into the AuthorizedGrant's AuthorizationContext when approving; the eventual access token issued via the device-code grant emits the claim byte-exact.

public System.Text.Json.Nodes.JsonArray? AuthorizationDetails { get; set; }

Property Value

System.Text.Json.Nodes.JsonArray

DeviceAuthorizationRequest.AuthorizedGrant Property

The authorized grant containing the user's authentication session and authorization context. This is set when the user successfully authorizes the device.

public Abblix.Oidc.Server.Endpoints.Token.Interfaces.AuthorizedGrant? AuthorizedGrant { get; set; }

Property Value

AuthorizedGrant

DeviceAuthorizationRequest.ClientId Property

The client identifier that initiated the device authorization request.

public string ClientId { get; init; }

Property Value

System.String

DeviceAuthorizationRequest.ExpiresAt Property

The absolute time when this device authorization request expires (RFC 8628 §3.2 fixed lifetime). Seeded by the storage on StoreAsync and used to cap the refreshed cache TTL at the remaining lifetime, so regular polling cannot extend the code.

public System.DateTimeOffset ExpiresAt { get; set; }

Property Value

System.DateTimeOffset

DeviceAuthorizationRequest.NextPollAt Property

Specifies the next time the client should poll for updates regarding the authorization request. This helps manage the timing of polling requests and enforces rate limiting.

public System.Nullable<System.DateTimeOffset> NextPollAt { get; set; }

Property Value

System.Nullable<System.DateTimeOffset>

DeviceAuthorizationRequest.Resources Property

The requested resources (RFC 8707) for the authorization.

public System.Uri[]? Resources { get; init; }

Property Value

System.Uri[]

DeviceAuthorizationRequest.Scope Property

The requested scopes for the authorization.

public string[] Scope { get; init; }

Property Value

System.String[]

DeviceAuthorizationRequest.Status Property

Indicates the current status of the device authorization request. Defaults to Pending, reflecting that the user has not yet completed authentication.

public Abblix.Oidc.Server.Features.DeviceAuthorization.DeviceAuthorizationStatus Status { get; set; }

Property Value

DeviceAuthorizationStatus

DeviceAuthorizationRequest.UserCode Property

The user-friendly code displayed to the user for verification.

public string UserCode { get; init; }

Property Value

System.String