Table of Contents

Class DeviceCodePrompt

Namespace
MailFathom.Common.OAuth
Assembly
MailFathom.Common.dll

What a person has to be shown to complete a device-code authorization on another device.

public sealed record DeviceCodePrompt : IEquatable<DeviceCodePrompt>
Inheritance
DeviceCodePrompt
Implements
Inherited Members

Remarks

The prompt is reported rather than printed, so the flow stays free of a console it does not own and the command decides how an operator sees it. Nothing here is a credential: the user code is single-use, bound to one pending authorization, and useless without the person signing in.

It is reported through an Action<T> rather than an IProgress<T>, because what the report has to guarantee is an ordering: the person cannot act on a code they have not been shown, so it must reach them before the flow starts waiting on their action. IProgress<T> promises the opposite — a report may be delivered asynchronously — and Progress<T>, the only implementation the platform ships, exists to marshal onto a captured SynchronizationContext. A console process has none, so the report degrades to a thread-pool work item that races the rest of the sign-in and the writes it makes to the terminal.

Constructors

DeviceCodePrompt(string, Uri, Uri?, DateTimeOffset)

What a person has to be shown to complete a device-code authorization on another device.

Properties

ExpiresAt

When the code stops being redeemable.

UserCode

The short code the person types at the verification address.

VerificationUri

The address the person opens in a browser.

VerificationUriComplete

The same address with the code already embedded, or null when the provider issued none.