Table of Contents

Class DefaultConsentService

Namespace
Duende.IdentityServer.Services
Assembly
Duende.IdentityServer.dll

Default consent service

public class DefaultConsentService : IConsentService
Inheritance
DefaultConsentService
Implements
Inherited Members

Constructors

DefaultConsentService(IClock, IUserConsentStore, ILogger<DefaultConsentService>)

Initializes a new instance of the DefaultConsentService class.

public DefaultConsentService(IClock clock, IUserConsentStore userConsentStore, ILogger<DefaultConsentService> logger)

Parameters

clock IClock

The clock.

userConsentStore IUserConsentStore

The user consent store.

logger ILogger<DefaultConsentService>

The logger.

Exceptions

ArgumentNullException

store

Fields

Clock

The clock

protected readonly IClock Clock

Field Value

IClock

Logger

The logger

protected readonly ILogger<DefaultConsentService> Logger

Field Value

ILogger<DefaultConsentService>

UserConsentStore

The user consent store

protected readonly IUserConsentStore UserConsentStore

Field Value

IUserConsentStore

Methods

RequiresConsentAsync(ClaimsPrincipal, Client, IEnumerable<ParsedScopeValue>)

Checks if consent is required.

public virtual Task<bool> RequiresConsentAsync(ClaimsPrincipal subject, Client client, IEnumerable<ParsedScopeValue> parsedScopes)

Parameters

subject ClaimsPrincipal

The user.

client Client

The client.

parsedScopes IEnumerable<ParsedScopeValue>

The parsed scopes.

Returns

Task<bool>

Boolean if consent is required.

Exceptions

ArgumentNullException

client or subject

UpdateConsentAsync(ClaimsPrincipal, Client, IEnumerable<ParsedScopeValue>)

Updates the consent asynchronous.

public virtual Task UpdateConsentAsync(ClaimsPrincipal subject, Client client, IEnumerable<ParsedScopeValue> parsedScopes)

Parameters

subject ClaimsPrincipal

The subject.

client Client

The client.

parsedScopes IEnumerable<ParsedScopeValue>

The parsed scopes.

Returns

Task

Exceptions

ArgumentNullException

client or subject