Class BackChannelAuthenticationInteractionService
- 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 BackChannelAuthenticationInteractionService : IBackchannelAuthenticationInteractionService
- Inheritance
-
BackChannelAuthenticationInteractionService
- Implements
- Inherited Members
Constructors
BackChannelAuthenticationInteractionService(IBackChannelAuthenticationRequestStore, IClientStore, IResourceValidator, IBackChannelAuthenticationNotificationHttpClient, ITokenRequestValidator, ITokenResponseGenerator, IIssuerNameService, IEventService, TimeProvider, IUserSession?)
public BackChannelAuthenticationInteractionService(IBackChannelAuthenticationRequestStore store, IClientStore clients, IResourceValidator resourceValidator, IBackChannelAuthenticationNotificationHttpClient notifier, ITokenRequestValidator tokenRequests, ITokenResponseGenerator tokenResponses, IIssuerNameService issuers, IEventService events, TimeProvider time, IUserSession? session = null)
Parameters
storeIBackChannelAuthenticationRequestStoreThe store the pending requests are read from, and the user's decision written back to.
clientsIClientStoreFinds the client behind a request, to describe it to the user and to reach its notification endpoint.
resourceValidatorIResourceValidatorResolves a request's scopes into the resources a consent page shows.
notifierIBackChannelAuthenticationNotificationHttpClientSends a ping client its notification, or a push client its tokens, once the user has answered.
tokenRequestsITokenRequestValidatorValidates the redemption a push makes on the client's behalf, exactly as a poll is validated.
tokenResponsesITokenResponseGeneratorMints the tokens a push delivers.
issuersIIssuerNameServiceSupplies the issuer the tokens a push delivers are minted under.
eventsIEventServiceRaises the token events for a push, and the failure event when a client cannot be notified.
timeTimeProviderThe clock that decides whether a request has expired, and the
auth_timeof an approval with no sign-in time.sessionIUserSessionThe browser's session, whose id the approval records on the request, as Duende's
CompleteLoginRequestAsyncdoes, so the tokens the client collects carry thesidof the session they were approved in.
BackChannelAuthenticationInteractionService(IBackChannelAuthenticationRequestStore, IClientStore, IResourceValidator, IBackChannelAuthenticationNotificationHttpClient, ITokenRequestValidator, ITokenResponseGenerator, IIssuerNameService, IEventService, TimeProvider, IUserSession?, IHttpContextAccessor)
public BackChannelAuthenticationInteractionService(IBackChannelAuthenticationRequestStore store, IClientStore clients, IResourceValidator resourceValidator, IBackChannelAuthenticationNotificationHttpClient notifier, ITokenRequestValidator tokenRequests, ITokenResponseGenerator tokenResponses, IIssuerNameService issuers, IEventService events, TimeProvider time, IUserSession? session, IHttpContextAccessor httpContextAccessor)
Parameters
storeIBackChannelAuthenticationRequestStoreThe store the pending requests are read from, and the user's decision written back to.
clientsIClientStoreFinds the client behind a request, to describe it to the user and to reach its notification endpoint.
resourceValidatorIResourceValidatorResolves a request's scopes into the resources a consent page shows.
notifierIBackChannelAuthenticationNotificationHttpClientSends a ping client its notification, or a push client its tokens, once the user has answered.
tokenRequestsITokenRequestValidatorValidates the redemption a push makes on the client's behalf, exactly as a poll is validated.
tokenResponsesITokenResponseGeneratorMints the tokens a push delivers.
issuersIIssuerNameServiceSupplies the issuer the tokens a push delivers are minted under.
eventsIEventServiceRaises the token events for a push, and the failure event when a client cannot be notified.
timeTimeProviderThe clock that decides whether a request has expired, and the
auth_timeof an approval with no sign-in time.sessionIUserSessionThe browser's session, as above.
httpContextAccessorIHttpContextAccessorThe request the user answers in, whose user is the approver when
sessioncannot say — a session written before 0.158.0 answersGetUserAsyncwith NotSupportedException.
Methods
CompleteRequestAsync(string, ConsentResponse, string, CancellationToken)
Records the user's decision. Returns false if the id no longer identifies a live request of theirs.
public Task<bool> CompleteRequestAsync(string id, ConsentResponse consent, string subjectId, CancellationToken cancellationToken = default)
Parameters
idstringconsentConsentResponsesubjectIdstringcancellationTokenCancellationToken
Returns
Exceptions
- ArgumentNullException
consentis null.
GetPendingRequestsAsync(string, CancellationToken)
The requests still waiting on an answer from this subject.
public Task<IReadOnlyCollection<BackChannelAuthenticationRequestContext>> GetPendingRequestsAsync(string subjectId, CancellationToken cancellationToken = default)
Parameters
subjectIdstringcancellationTokenCancellationToken
Returns
Exceptions
- ArgumentException
subjectIdis null or empty.
GetRequestAsync(string, string, CancellationToken)
One pending request, or null when it is not this subject's to answer.
public Task<BackChannelAuthenticationRequestContext?> GetRequestAsync(string id, string subjectId, CancellationToken cancellationToken = default)
Parameters
idstringsubjectIdstringcancellationTokenCancellationToken