Constructor DeviceCodePrompt
- Namespace
- MailFathom.Common.OAuth
- Assembly
- MailFathom.Common.dll
DeviceCodePrompt(string, Uri, Uri?, DateTimeOffset)
What a person has to be shown to complete a device-code authorization on another device.
public DeviceCodePrompt(string UserCode, Uri VerificationUri, Uri? VerificationUriComplete, DateTimeOffset ExpiresAt)
Parameters
UserCodestringThe short code the person types at the verification address.
VerificationUriUriThe address the person opens in a browser.
VerificationUriCompleteUriThe same address with the code already embedded, or null when the provider issued none.
ExpiresAtDateTimeOffsetWhen the code stops being redeemable.
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.