Class ConsentService

Assembly: redb.Identity.Core.dll

Manages explicit user consent grants. Consent is stored as an OpenIddict Authorization
with Type = "permanent" and Status = "valid".
This is a thin wrapper over that queries
directly for performance.

public sealed class ConsentService

Inheritance

Object→ConsentService

Methods

CheckAsync(long, long, IReadOnlyCollection<string>, CancellationToken)

Checks whether the user has an existing valid permanent consent for the given application

public Task<RedbObject<AuthorizationProps>?> CheckAsync(long userId, long applicationId, IReadOnlyCollection<string> requestedScopes, CancellationToken ct = default)

FindApplicationIdAsync(string, CancellationToken)

Finds the application object ID by client_id.

public Task<long?> FindApplicationIdAsync(string clientId, CancellationToken ct = default)

GrantAsync(long, long, IReadOnlyCollection<string>, CancellationToken)

Creates or extends a permanent consent grant.

public Task<RedbObject<AuthorizationProps>> GrantAsync(long userId, long applicationId, IReadOnlyCollection<string> scopes, CancellationToken ct = default)

ListAsync(long, CancellationToken)

Lists all valid permanent consent grants for a user.

public Task<List<ConsentService.ConsentInfo>> ListAsync(long userId, CancellationToken ct = default)

RevokeAllAsync(long, CancellationToken)

Revokes ALL permanent consent grants for a user (across all applications).

public Task<int> RevokeAllAsync(long userId, CancellationToken ct = default)

RevokeAsync(long, long, CancellationToken)

Revokes all permanent consent grants for a user+application pair.

public Task<int> RevokeAsync(long userId, long applicationId, CancellationToken ct = default)

Constructors