Class InMemoryBackChannelAuthenticationRequestStore
- Namespace
- Fdyay.IdentityServer.Stores.InMemory
- Assembly
- Fdyay.IdentityServer.Core.dll
In-process backchannel authentication request store, for a single-instance host.
public sealed class InMemoryBackChannelAuthenticationRequestStore : IBackChannelAuthenticationRequestStore
- Inheritance
-
InMemoryBackChannelAuthenticationRequestStore
- Implements
- Inherited Members
Remarks
A second instance would not see the first's pending requests, so a client could poll one instance while the
user answered on another and never receive a token. A multi-instance host replaces this with
DapperBackChannelAuthenticationRequestStore, through DapperStores.BackChannelAuthentication.
Nothing prunes an expired request here, matching InMemoryDeviceFlowStore: a request past its
lifetime is refused wherever it is read, so the only cost of leaving it is the memory it occupies until the
process restarts. A durable store needs a sweep, which is one of the reasons it is not this one — and the
durable store added in 0.67.0 has that sweep, in TokenCleanup beside the device codes'.
Methods
FindByAuthenticationRequestIdAsync(string, CancellationToken)
Finds the request a client is polling for.
public Task<BackChannelAuthenticationRequest?> FindByAuthenticationRequestIdAsync(string authenticationRequestId, CancellationToken cancellationToken = default)
Parameters
authenticationRequestIdstringcancellationTokenCancellationToken
Returns
FindByInternalIdAsync(string, CancellationToken)
Finds the request the approval surface is acting on.
public Task<BackChannelAuthenticationRequest?> FindByInternalIdAsync(string internalId, CancellationToken cancellationToken = default)
Parameters
internalIdstringcancellationTokenCancellationToken
Returns
FindPendingForSubjectAsync(string, CancellationToken)
The requests still waiting on an answer from this subject.
public Task<IReadOnlyCollection<BackChannelAuthenticationRequest>> FindPendingForSubjectAsync(string subjectId, CancellationToken cancellationToken = default)
Parameters
subjectIdstringcancellationTokenCancellationToken
Returns
RemoveByInternalIdAsync(string, CancellationToken)
Removes a request under both keys.
public Task RemoveByInternalIdAsync(string internalId, CancellationToken cancellationToken = default)
Parameters
internalIdstringcancellationTokenCancellationToken
Returns
StoreAsync(string, BackChannelAuthenticationRequest, CancellationToken)
Stores a new request under both keys.
public Task StoreAsync(string authenticationRequestId, BackChannelAuthenticationRequest request, CancellationToken cancellationToken = default)
Parameters
authenticationRequestIdstringrequestBackChannelAuthenticationRequestcancellationTokenCancellationToken
Returns
UpdateByInternalIdAsync(string, BackChannelAuthenticationRequest, CancellationToken)
Replaces a request, by the key the approval surface holds.
public Task UpdateByInternalIdAsync(string internalId, BackChannelAuthenticationRequest request, CancellationToken cancellationToken = default)
Parameters
internalIdstringrequestBackChannelAuthenticationRequestcancellationTokenCancellationToken