Interface IBackchannelAuthenticationInteractionService
- Namespace
- Fdyay.IdentityServer.Services
- Assembly
- Fdyay.IdentityServer.AspNetCore.dll
Surfaces pending backchannel requests to the UI, and records the user's answer.
public interface IBackchannelAuthenticationInteractionService
Remarks
The counterpart to IDeviceFlowInteractionService, and it differs in the one way the two flows differ. A device code is answered by whoever holds the code — the code is the proof, and any signed-in user may approve it. A backchannel request names its user before anyone is asked anything, so every member here takes the subject doing the answering and refuses a request belonging to somebody else.
That check is not defence in depth, it is the flow's integrity. Without it a client could name one user, and the request would be approvable by any other who reached the page — which would make "authenticate this person" mean "authenticate whoever answers".
Methods
CompleteRequestAsync(string, ConsentResponse, string, CancellationToken)
Records the user's decision. Returns false if the id no longer identifies a live request of theirs.
Task<bool> CompleteRequestAsync(string id, ConsentResponse consent, string subjectId, CancellationToken cancellationToken = default)
Parameters
idstringconsentConsentResponsesubjectIdstringcancellationTokenCancellationToken
Returns
GetPendingRequestsAsync(string, CancellationToken)
The requests still waiting on an answer from this subject.
Task<IReadOnlyCollection<BackChannelAuthenticationRequestContext>> GetPendingRequestsAsync(string subjectId, CancellationToken cancellationToken = default)
Parameters
subjectIdstringcancellationTokenCancellationToken
Returns
GetRequestAsync(string, string, CancellationToken)
One pending request, or null when it is not this subject's to answer.
Task<BackChannelAuthenticationRequestContext?> GetRequestAsync(string id, string subjectId, CancellationToken cancellationToken = default)
Parameters
idstringsubjectIdstringcancellationTokenCancellationToken