Class InMemoryDeviceFlowThrottlingService
- Namespace
- Fdyay.IdentityServer.Services
- Assembly
- Fdyay.IdentityServer.Core.dll
In-process throttle, keyed on the device code.
public sealed class InMemoryDeviceFlowThrottlingService : IDeviceFlowThrottlingService
- Inheritance
-
InMemoryDeviceFlowThrottlingService
- Implements
- Inherited Members
Remarks
The counting is Fdyay.IdentityServer.Services.PollingThrottle's, shared with CIBA's poll mode: what differs between the two flows is which option supplies the interval, not what "too soon" means.
Constructors
InMemoryDeviceFlowThrottlingService(TimeProvider, IOptions<IdentityServerOptions>)
An in-process throttle at the interval options sets.
public InMemoryDeviceFlowThrottlingService(TimeProvider time, IOptions<IdentityServerOptions> options)
Parameters
timeTimeProviderThe clock a poll is timed by.
optionsIOptions<IdentityServerOptions>The server's options;
DeviceFlow.Intervalis the interval enforced, in seconds.
Methods
ShouldSlowDownAsync(string, DeviceCode, CancellationToken)
Records this poll and returns true if it arrived sooner than the interval allows.
public Task<bool> ShouldSlowDownAsync(string deviceCode, DeviceCode data, CancellationToken cancellationToken = default)
Parameters
deviceCodestringdataDeviceCodecancellationTokenCancellationToken