Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

interface Duende.​IdentityServer.​Services.​IDeviceFlowInteractionService

Assembly: Duende.IdentityServer

Provides services used by the user interface to communicate with IdentityServer during OAuth 2.0 Device Authorization Grant (device flow) authorization. This service is available from the dependency injection system and is typically injected as a constructor parameter into MVC controllers that implement the device flow UI.

Methods

GetAuthorizationContextAsync​(string userCode, System.​Threading.​CancellationToken ct)
Returns the <see cref="T:Duende.IdentityServer.Models.DeviceFlowAuthorizationRequest" /> based on the <paramref name="userCode" /> entered by the user on the device authorization page. Use this to retrieve the client and requested scopes so the UI can render the consent page.
Returns The <see cref="T:Duende.IdentityServer.Models.DeviceFlowAuthorizationRequest" /> describing the pending device authorization, including the client identifier and the requested scopes, or <c>null</c> if the user code is not valid or has expired.
userCode The user code entered by the user on the device authorization page.
ct The cancellation token.
HandleRequestAsync​(string userCode, Models.​ConsentResponse consent, System.​Threading.​CancellationToken ct)
Completes device authorization for the given <paramref name="userCode" /> by recording the user's consent decision. Call this after the user has approved or denied the request on the device consent page.
Returns A <see cref="T:Duende.IdentityServer.Models.DeviceFlowInteractionResult" /> indicating whether the authorization succeeded. Check <see cref="P:Duende.IdentityServer.Models.DeviceFlowInteractionResult.IsError" /> and <see cref="P:Duende.IdentityServer.Models.DeviceFlowInteractionResult.ErrorDescription" /> for failure details.
userCode The user code identifying the device authorization request to complete.
consent The user's consent response, including the scopes approved and whether to remember the decision.
ct The cancellation token.