Table of Contents

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

store IBackChannelAuthenticationRequestStore

The store the pending requests are read from, and the user's decision written back to.

clients IClientStore

Finds the client behind a request, to describe it to the user and to reach its notification endpoint.

resourceValidator IResourceValidator

Resolves a request's scopes into the resources a consent page shows.

notifier IBackChannelAuthenticationNotificationHttpClient

Sends a ping client its notification, or a push client its tokens, once the user has answered.

tokenRequests ITokenRequestValidator

Validates the redemption a push makes on the client's behalf, exactly as a poll is validated.

tokenResponses ITokenResponseGenerator

Mints the tokens a push delivers.

issuers IIssuerNameService

Supplies the issuer the tokens a push delivers are minted under.

events IEventService

Raises the token events for a push, and the failure event when a client cannot be notified.

time TimeProvider

The clock that decides whether a request has expired, and the auth_time of an approval with no sign-in time.

session IUserSession

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

store IBackChannelAuthenticationRequestStore

The store the pending requests are read from, and the user's decision written back to.

clients IClientStore

Finds the client behind a request, to describe it to the user and to reach its notification endpoint.

resourceValidator IResourceValidator

Resolves a request's scopes into the resources a consent page shows.

notifier IBackChannelAuthenticationNotificationHttpClient

Sends a ping client its notification, or a push client its tokens, once the user has answered.

tokenRequests ITokenRequestValidator

Validates the redemption a push makes on the client's behalf, exactly as a poll is validated.

tokenResponses ITokenResponseGenerator

Mints the tokens a push delivers.

issuers IIssuerNameService

Supplies the issuer the tokens a push delivers are minted under.

events IEventService

Raises the token events for a push, and the failure event when a client cannot be notified.

time TimeProvider

The clock that decides whether a request has expired, and the auth_time of an approval with no sign-in time.

session IUserSession

The browser's session, as above.

httpContextAccessor IHttpContextAccessor

The request the user answers in, whose user is the approver when session cannot say — a session written before 0.158.0 answers GetUserAsync with 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

id string
consent ConsentResponse
subjectId string
cancellationToken CancellationToken

Returns

Task<bool>

Exceptions

ArgumentNullException

consent is 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

subjectId string
cancellationToken CancellationToken

Returns

Task<IReadOnlyCollection<BackChannelAuthenticationRequestContext>>

Exceptions

ArgumentException

subjectId is 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

id string
subjectId string
cancellationToken CancellationToken

Returns

Task<BackChannelAuthenticationRequestContext>