Class DeviceFlowInteractionService
- Namespace
- Fdyay.IdentityServer.Services
- Assembly
- Fdyay.IdentityServer.AspNetCore.dll
Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.
public sealed class DeviceFlowInteractionService : IDeviceFlowInteractionService
- Inheritance
-
DeviceFlowInteractionService
- Implements
- Inherited Members
Constructors
DeviceFlowInteractionService(IDeviceFlowCodeService, IClientStore, IResourceValidator, TimeProvider, IUserSession?)
public DeviceFlowInteractionService(IDeviceFlowCodeService store, IClientStore clients, IResourceValidator resourceValidator, TimeProvider time, IUserSession? session = null)
Parameters
storeIDeviceFlowCodeServiceThe device codes, looked up by user code and updated with the user's decision.
clientsIClientStoreFinds the client a device code was issued to, so the page can show who is asking.
resourceValidatorIResourceValidatorResolves a device code's requested scopes into the resources the page shows.
timeTimeProviderThe clock that decides whether a device code has expired.
sessionIUserSessionThe browser's session, whose id the approval records on the device code, as Duende's does, so the tokens the device collects carry the
sidof the session they were approved in.
Methods
GetAuthorizationContextAsync(string, CancellationToken)
Resolves a user code to the request it identifies, or null if there is no live request for it.
public Task<DeviceFlowAuthorizationRequest?> GetAuthorizationContextAsync(string userCode, CancellationToken cancellationToken = default)
Parameters
userCodestringcancellationTokenCancellationToken
Returns
HandleRequestAsync(string, ConsentResponse, string, CancellationToken)
Records the user's decision. Returns false if the code no longer identifies a live request.
public Task<bool> HandleRequestAsync(string userCode, ConsentResponse consent, string subjectId, CancellationToken cancellationToken = default)
Parameters
userCodestringconsentConsentResponsesubjectIdstringcancellationTokenCancellationToken
Returns
Exceptions
- ArgumentNullException
consentis null.- ArgumentException
subjectIdis null or empty.