Device Flow Interaction Service
Duende.IdentityServer.Services.IDeviceFlowInteractionService
Section titled “Duende.IdentityServer.Services.IDeviceFlowInteractionService”The IDeviceFlowInteractionService interface is intended to provide services to be used by the user interface to
communicate with Duende IdentityServer during device flow authorization.
It is available from the dependency injection system and would normally be injected as a constructor parameter into your
MVC controllers for the user interface of IdentityServer.
IDeviceFlowInteractionService APIs
Section titled “IDeviceFlowInteractionService APIs”All async methods accept a CancellationToken ct parameter.
-
GetAuthorizationContextAsync(string userCode, CancellationToken ct)Returns the
DeviceFlowAuthorizationRequestbased on theuserCodepassed to the login or consent pages. -
HandleRequestAsync(string userCode, ConsentResponse consent, CancellationToken ct)Completes device authorization for the given
userCode. Note thatConsentResponse.RememberConsentis always treated asfalsein device flow. Consent is never persisted across device flow sessions. This follows RFC 8628 security guidance, since the device initiating the flow is different from the device where the user authenticates.
DeviceFlowAuthorizationRequest
Section titled “DeviceFlowAuthorizationRequest”-
ClientIdThe client identifier that initiated the request.
-
ScopesRequestedThe scopes requested from the authorization request.
DeviceFlowInteractionResult
Section titled “DeviceFlowInteractionResult”-
IsErrorSpecifies if the authorization request errored.
-
ErrorDescriptionError description upon failure.