Class BackchannelAuthenticationResponseGenerator
- Namespace
- Fdyay.IdentityServer.ResponseHandling
- Assembly
- Fdyay.IdentityServer.Core.dll
Duende's default backchannel authentication response generator.
public class BackchannelAuthenticationResponseGenerator : IBackchannelAuthenticationResponseGenerator
- Inheritance
-
BackchannelAuthenticationResponseGenerator
- Implements
- Inherited Members
Constructors
BackchannelAuthenticationResponseGenerator(IOptions<IdentityServerOptions>, IBackChannelAuthenticationRequestStore, IBackchannelAuthenticationUserNotificationService, IHandleGenerationService, TimeProvider, ILogger<BackchannelAuthenticationResponseGenerator>)
Creates the generator.
public BackchannelAuthenticationResponseGenerator(IOptions<IdentityServerOptions> options, IBackChannelAuthenticationRequestStore requests, IBackchannelAuthenticationUserNotificationService notifications, IHandleGenerationService handles, TimeProvider timeProvider, ILogger<BackchannelAuthenticationResponseGenerator> logger)
Parameters
optionsIOptions<IdentityServerOptions>The server's options, for the CIBA polling interval.
requestsIBackChannelAuthenticationRequestStoreWhere backchannel requests are kept.
notificationsIBackchannelAuthenticationUserNotificationServiceReaches the user the request names.
handlesIHandleGenerationServiceGenerates the
auth_req_idand the request's internal id.timeProviderTimeProviderThe clock the request's creation time is read from.
loggerILogger<BackchannelAuthenticationResponseGenerator>Where a failed notification is logged.
Exceptions
- ArgumentNullException
optionsisnull.
Properties
Handles
Generates the auth_req_id and the internal id, which Duende's store generates inside itself.
protected IHandleGenerationService Handles { get; }
Property Value
Logger
Where a failed notification is logged.
protected ILogger Logger { get; }
Property Value
Notifications
Reaches the user. Duende's UserLoginService.
protected IBackchannelAuthenticationUserNotificationService Notifications { get; }
Property Value
Options
The server's options; Ciba.Interval is the polling interval a client is told.
protected IdentityServerOptions Options { get; }
Property Value
Requests
Where backchannel requests are kept. Duende's BackChannelAuthenticationRequestStore.
protected IBackChannelAuthenticationRequestStore Requests { get; }
Property Value
TimeProvider
The clock a stored request's creation time is read from.
protected TimeProvider TimeProvider { get; }
Property Value
Methods
ProcessAsync(BackchannelAuthenticationRequestValidationResult, CancellationToken)
Stores the validated request, notifies the user, and builds the response for the client.
public virtual Task<BackchannelAuthenticationResponse> ProcessAsync(BackchannelAuthenticationRequestValidationResult validationResult, CancellationToken ct)
Parameters
validationResultBackchannelAuthenticationRequestValidationResultThe successfully validated backchannel authentication request.
ctCancellationTokenCancels the storage and the notification.
Returns
- Task<BackchannelAuthenticationResponse>
The
auth_req_id, its lifetime and the polling interval; or an error when the request cannot be answered.
Remarks
A notification that fails removes the stored request and answers server_error, so the client is never handed
an auth_req_id nobody was told about.
Exceptions
- ArgumentNullException
validationResultisnull.- ArgumentException
The validated request names no client.