Class InMemoryBackChannelAuthenticationThrottlingService
- Namespace
- Fdyay.IdentityServer.Services
- Assembly
- Fdyay.IdentityServer.Core.dll
In-process throttle, keyed on the auth_req_id.
public sealed class InMemoryBackChannelAuthenticationThrottlingService : IBackchannelAuthenticationThrottlingService
- Inheritance
-
InMemoryBackChannelAuthenticationThrottlingService
- Implements
- Inherited Members
Remarks
The counting is Fdyay.IdentityServer.Services.PollingThrottle's, shared with the device flow: what differs between the two is where the interval comes from, not what "too soon" means.
And it comes from the request rather than from the options, because the request records the number this
client was actually told when it started. A host that shortens the configured interval afterwards would
otherwise start answering slow_down to a client polling at exactly the rate this server gave it.
Constructors
InMemoryBackChannelAuthenticationThrottlingService(TimeProvider)
An in-process throttle.
public InMemoryBackChannelAuthenticationThrottlingService(TimeProvider time)
Parameters
timeTimeProviderThe clock a poll is timed by.
Methods
ShouldSlowDownAsync(string, BackChannelAuthenticationRequest, CancellationToken)
Records this poll and returns true if it arrived sooner than the interval allows.
public Task<bool> ShouldSlowDownAsync(string authenticationRequestId, BackChannelAuthenticationRequest request, CancellationToken cancellationToken = default)
Parameters
authenticationRequestIdstringrequestBackChannelAuthenticationRequestcancellationTokenCancellationToken