Class DeviceAuthorizationResponseGenerator
- Namespace
- Fdyay.IdentityServer.ResponseHandling
- Assembly
- Fdyay.IdentityServer.Core.dll
Duende's default device authorization response generator.
public class DeviceAuthorizationResponseGenerator : IDeviceAuthorizationResponseGenerator
- Inheritance
-
DeviceAuthorizationResponseGenerator
- Implements
- Inherited Members
Constructors
DeviceAuthorizationResponseGenerator(IOptions<IdentityServerOptions>, IUserCodeService, IDeviceFlowCodeService, TimeProvider)
Creates the generator.
public DeviceAuthorizationResponseGenerator(IOptions<IdentityServerOptions> options, IUserCodeService userCodeService, IDeviceFlowCodeService deviceFlowCodeService, TimeProvider timeProvider)
Parameters
optionsIOptions<IdentityServerOptions>The server's options, for the device flow's lifetime, interval and verification URL.
userCodeServiceIUserCodeServiceFinds the generator for a user code type.
deviceFlowCodeServiceIDeviceFlowCodeServiceStores the device authorization and looks user codes up.
timeProviderTimeProviderThe clock the device code's creation time is read from.
Exceptions
- ArgumentNullException
optionsisnull.
Properties
DeviceFlowCodeService
Makes and keeps device codes, and never hands the store one as issued. Duende's.
protected IDeviceFlowCodeService DeviceFlowCodeService { get; }
Property Value
Options
The server's options; DeviceFlow holds the defaults a client's registration can override.
protected IdentityServerOptions Options { get; }
Property Value
TimeProvider
The clock a device code's creation time is read from.
protected TimeProvider TimeProvider { get; }
Property Value
UserCodeService
Finds the user code generator for the client's user code type, or the server's default type.
protected IUserCodeService UserCodeService { get; }
Property Value
Methods
ProcessAsync(DeviceAuthorizationRequestValidationResult, string, CancellationToken)
Generates and stores the codes for a validated request and builds the response for the device.
public virtual Task<DeviceAuthorizationResponse> ProcessAsync(DeviceAuthorizationRequestValidationResult validationResult, string baseUrl, CancellationToken ct)
Parameters
validationResultDeviceAuthorizationRequestValidationResultThe successfully validated device authorization request.
baseUrlstringThe server's base URL, which a local verification URL is resolved against.
ctCancellationTokenCancels the code generation and storage.
Returns
- Task<DeviceAuthorizationResponse>
The device code, user code, verification URIs, lifetime and polling interval.
Exceptions
- ArgumentNullException
validationResultisnull.- ArgumentException
baseUrlis null, empty or whitespace, or the validated request names no client.- InvalidOperationException
No user code generator is registered for the type, or none of its tries produced a user code not already in use.