Interface IUserCodeGenerator
- Namespace
- Fdyay.IdentityServer.Services
- Assembly
- Fdyay.IdentityServer.Core.dll
Makes user codes of one type (Duende's IUserCodeGenerator).
public interface IUserCodeGenerator
Remarks
Registered as many times as there are types; a client chooses one by Client.UserCodeType. A generator
only has to make codes — whether one is already in use is checked by the caller, which tries again up to
RetryLimit times.
Properties
RetryLimit
How many codes may be tried for one device before giving up on finding an unused one.
int RetryLimit { get; }
Property Value
UserCodeType
The name a client or DeviceFlowOptions.DefaultUserCodeType selects this generator by.
string UserCodeType { get; }
Property Value
Methods
GenerateAsync(CancellationToken)
A new user code of this generator's type. Whether it is already in use is the caller's to check.
Task<string> GenerateAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancels the generation.