Class NumericUserCodeGenerator
- Namespace
- Fdyay.IdentityServer.Services
- Assembly
- Fdyay.IdentityServer.Core.dll
Nine digits, as Duende's NumericUserCodeGenerator: for a device with a numeric keypad.
public sealed class NumericUserCodeGenerator : IUserCodeGenerator
- Inheritance
-
NumericUserCodeGenerator
- Implements
- Inherited Members
Remarks
Measured: GetInt32(100000000, 1000000000), so never a leading zero, and a retry limit of five. About 30
bits, which is why it is chosen per client rather than being the default here.
Properties
RetryLimit
How many codes may be tried for one device before giving up on finding an unused one.
public int RetryLimit { get; }
Property Value
Remarks
UserCodeType
The name a client or DeviceFlowOptions.DefaultUserCodeType selects this generator by.
public string UserCodeType { get; }
Property Value
Remarks
Methods
GenerateAsync(CancellationToken)
A new user code of this generator's type. Whether it is already in use is the caller's to check.
public Task<string> GenerateAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancels the generation.