Interface IAuthorizationCodeStore
- Namespace
- Fdyay.IdentityServer.Services
- Assembly
- Fdyay.IdentityServer.Core.dll
Stores and retrieves authorization codes.
public interface IAuthorizationCodeStore
Methods
GetAuthorizationCodeAsync(string, CancellationToken)
The authorization code a handle names, or null.
Task<AuthorizationCode?> GetAuthorizationCodeAsync(string code, CancellationToken cancellationToken = default)
Parameters
codestringThe handle the client presented.
cancellationTokenCancellationTokenCancels the read.
Returns
- Task<AuthorizationCode>
The code, or null when none is stored under the handle or it has expired.
RemoveAuthorizationCodeAsync(string, CancellationToken)
Removes the authorization code a handle names, so it cannot be redeemed again.
Task RemoveAuthorizationCodeAsync(string code, CancellationToken cancellationToken = default)
Parameters
codestringThe handle the client presented.
cancellationTokenCancellationTokenCancels the removal.
Returns
StoreAuthorizationCodeAsync(AuthorizationCode, CancellationToken)
Stores an authorization code and returns the handle the client is given for it.
Task<string> StoreAuthorizationCodeAsync(AuthorizationCode code, CancellationToken cancellationToken = default)
Parameters
codeAuthorizationCodeThe code's contents.
cancellationTokenCancellationTokenCancels the write.
Returns
TryRemoveAuthorizationCodeAsync(string, CancellationToken)
Removes the authorization code a handle names, saying whether this call is the one that removed it.
Task<bool> TryRemoveAuthorizationCodeAsync(string code, CancellationToken cancellationToken = default)
Parameters
codestringThe handle the client presented.
cancellationTokenCancellationTokenCancels the removal.
Returns
Remarks
What the token endpoint redeems a code by, so of two requests presenting one code at the same moment only one is answered with tokens (RFC 6749 §4.1.2: a code is used once). Ours (security), 0.176.0; Duende reads the code and then removes it. The default store takes it in one step through TryRemoveAsync(string, CancellationToken); this default, for a code store of a host's own written before 0.176.0, removes and answers true, as before.