Class TokenRevocationResponseGenerator
- Namespace
- Fdyay.IdentityServer.ResponseHandling
- Assembly
- Fdyay.IdentityServer.Core.dll
Duende's default revocation response generator.
public class TokenRevocationResponseGenerator : ITokenRevocationResponseGenerator
- Inheritance
-
TokenRevocationResponseGenerator
- Implements
- Inherited Members
Constructors
TokenRevocationResponseGenerator(IReferenceTokenStore, IRefreshTokenStore)
public TokenRevocationResponseGenerator(IReferenceTokenStore referenceTokens, IRefreshTokenStore refreshTokens)
Parameters
referenceTokensIReferenceTokenStorerefreshTokensIRefreshTokenStore
Remarks
The constructor this had before 0.167.0, kept: the options read as the defaults.
TokenRevocationResponseGenerator(IReferenceTokenStore, IRefreshTokenStore, IOptions<IdentityServerOptions>?)
[ActivatorUtilitiesConstructor]
public TokenRevocationResponseGenerator(IReferenceTokenStore referenceTokens, IRefreshTokenStore refreshTokens, IOptions<IdentityServerOptions>? options)
Parameters
referenceTokensIReferenceTokenStoreWhere reference access tokens are kept.
refreshTokensIRefreshTokenStoreWhere refresh tokens are kept.
optionsIOptions<IdentityServerOptions>The server's options, for ConsumedRefreshTokenGracePeriod. Null reads as the defaults.
Remarks
New in 0.167.0, an overload rather than a parameter added to the one above. The one the container builds, as the
longer and as marked for ActivatorUtilities.
Properties
ReferenceTokens
Where reference access tokens are kept.
protected IReferenceTokenStore ReferenceTokens { get; }
Property Value
RefreshTokens
Where refresh tokens are kept.
protected IRefreshTokenStore RefreshTokens { get; }
Property Value
Methods
ProcessAsync(TokenRevocationRequestValidationResult, CancellationToken)
Revokes the token the validated request names, when it is one of the client's.
public virtual Task<TokenRevocationResponse> ProcessAsync(TokenRevocationRequestValidationResult validationResult, CancellationToken ct)
Parameters
validationResultTokenRevocationRequestValidationResultThe validated revocation request: the token, its type hint and the client.
ctCancellationTokenCancels the store lookups and removals.
Returns
- Task<TokenRevocationResponse>
Whether a token was revoked, and which kind.
Exceptions
- ArgumentNullException
validationResultisnull.
RevokeAccessTokenAsync(TokenRevocationRequestValidationResult, CancellationToken)
Revokes the token as a reference access token of the client's, answering whether it was one.
protected virtual Task<bool> RevokeAccessTokenAsync(TokenRevocationRequestValidationResult validationResult, CancellationToken ct)
Parameters
validationResultTokenRevocationRequestValidationResultctCancellationToken
Returns
RevokeRefreshTokenAsync(TokenRevocationRequestValidationResult, CancellationToken)
Revokes the token as a refresh token of the client's, answering whether it was one.
protected virtual Task<bool> RevokeRefreshTokenAsync(TokenRevocationRequestValidationResult validationResult, CancellationToken ct)
Parameters
validationResultTokenRevocationRequestValidationResultctCancellationToken
Returns
Remarks
The reference access tokens issued beside it in the same session go with it: they were obtained on the strength of the grant being revoked, and RFC 7009 §2.1 lets a server revoke them for that reason.
With ConsumedRefreshTokenGracePeriod on, so does its lineage — the tokens it was rotated from and any fork, as a replay revokes them. Ours: Duende's removes the one handle, which with a window open would leave the token it was rotated from acceptable, and so a way back into a session its client has just ended. With the window off, the one handle, as Duende's.