Table of Contents

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

store IDeviceFlowCodeService

The device codes, looked up by user code and updated with the user's decision.

clients IClientStore

Finds the client a device code was issued to, so the page can show who is asking.

resourceValidator IResourceValidator

Resolves a device code's requested scopes into the resources the page shows.

time TimeProvider

The clock that decides whether a device code has expired.

session IUserSession

The browser's session, whose id the approval records on the device code, as Duende's does, so the tokens the device collects carry the sid of 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

userCode string
cancellationToken CancellationToken

Returns

Task<DeviceFlowAuthorizationRequest>

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

userCode string
consent ConsentResponse
subjectId string
cancellationToken CancellationToken

Returns

Task<bool>

Exceptions

ArgumentNullException

consent is null.

ArgumentException

subjectId is null or empty.