|
|
@ -1055,6 +1055,22 @@ public class OpenIddictTokenManager<TToken> : IOpenIddictTokenManager where TTok |
|
|
public virtual ValueTask<long> PruneAsync(DateTimeOffset threshold, CancellationToken cancellationToken = default) |
|
|
public virtual ValueTask<long> PruneAsync(DateTimeOffset threshold, CancellationToken cancellationToken = default) |
|
|
=> Store.PruneAsync(threshold, cancellationToken); |
|
|
=> Store.PruneAsync(threshold, cancellationToken); |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Revokes all the tokens associated with the specified application identifier.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="identifier">The application identifier associated with the tokens.</param>
|
|
|
|
|
|
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
|
|
|
|
|
|
/// <returns>The number of tokens associated with the specified application that were marked as revoked.</returns>
|
|
|
|
|
|
public virtual ValueTask<long> RevokeByApplicationIdAsync(string identifier, CancellationToken cancellationToken = default) |
|
|
|
|
|
{ |
|
|
|
|
|
if (string.IsNullOrEmpty(identifier)) |
|
|
|
|
|
{ |
|
|
|
|
|
throw new ArgumentException(SR.GetResourceString(SR.ID0195), nameof(identifier)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return Store.RevokeByApplicationIdAsync(identifier, cancellationToken); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Revokes all the tokens associated with the specified authorization identifier.
|
|
|
/// Revokes all the tokens associated with the specified authorization identifier.
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
@ -1071,6 +1087,22 @@ public class OpenIddictTokenManager<TToken> : IOpenIddictTokenManager where TTok |
|
|
return Store.RevokeByAuthorizationIdAsync(identifier, cancellationToken); |
|
|
return Store.RevokeByAuthorizationIdAsync(identifier, cancellationToken); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Revokes all the tokens associated with the specified subject.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="subject">The subject associated with the tokens.</param>
|
|
|
|
|
|
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
|
|
|
|
|
|
/// <returns>The number of tokens associated with the specified subject that were marked as revoked.</returns>
|
|
|
|
|
|
public virtual ValueTask<long> RevokeBySubjectAsync(string subject, CancellationToken cancellationToken = default) |
|
|
|
|
|
{ |
|
|
|
|
|
if (string.IsNullOrEmpty(subject)) |
|
|
|
|
|
{ |
|
|
|
|
|
throw new ArgumentException(SR.GetResourceString(SR.ID0195), nameof(subject)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return Store.RevokeBySubjectAsync(subject, cancellationToken); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Tries to redeem a token.
|
|
|
/// Tries to redeem a token.
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
@ -1501,10 +1533,18 @@ public class OpenIddictTokenManager<TToken> : IOpenIddictTokenManager where TTok |
|
|
ValueTask<long> IOpenIddictTokenManager.PruneAsync(DateTimeOffset threshold, CancellationToken cancellationToken) |
|
|
ValueTask<long> IOpenIddictTokenManager.PruneAsync(DateTimeOffset threshold, CancellationToken cancellationToken) |
|
|
=> PruneAsync(threshold, cancellationToken); |
|
|
=> PruneAsync(threshold, cancellationToken); |
|
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
ValueTask<long> IOpenIddictTokenManager.RevokeByApplicationIdAsync(string identifier, CancellationToken cancellationToken) |
|
|
|
|
|
=> RevokeByApplicationIdAsync(identifier, cancellationToken); |
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
/// <inheritdoc/>
|
|
|
ValueTask<long> IOpenIddictTokenManager.RevokeByAuthorizationIdAsync(string identifier, CancellationToken cancellationToken) |
|
|
ValueTask<long> IOpenIddictTokenManager.RevokeByAuthorizationIdAsync(string identifier, CancellationToken cancellationToken) |
|
|
=> RevokeByAuthorizationIdAsync(identifier, cancellationToken); |
|
|
=> RevokeByAuthorizationIdAsync(identifier, cancellationToken); |
|
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
ValueTask<long> IOpenIddictTokenManager.RevokeBySubjectAsync(string subject, CancellationToken cancellationToken) |
|
|
|
|
|
=> RevokeBySubjectAsync(subject, cancellationToken); |
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
/// <inheritdoc/>
|
|
|
ValueTask<bool> IOpenIddictTokenManager.TryRedeemAsync(object token, CancellationToken cancellationToken) |
|
|
ValueTask<bool> IOpenIddictTokenManager.TryRedeemAsync(object token, CancellationToken cancellationToken) |
|
|
=> TryRedeemAsync((TToken) token, cancellationToken); |
|
|
=> TryRedeemAsync((TToken) token, cancellationToken); |
|
|
|