Table of Contents

Class DapperClientStore

Namespace
Fdyay.IdentityServer.Dapper.Stores
Assembly
Fdyay.IdentityServer.Dapper.dll

Dapper-backed client store. Clients are persisted as JSON keyed by client id.

public sealed class DapperClientStore : IClientStore
Inheritance
DapperClientStore
Implements
Inherited Members

Constructors

DapperClientStore(IDbConnectionFactory)

Creates a client store over the Clients table.

public DapperClientStore(IDbConnectionFactory connectionFactory)

Parameters

connectionFactory IDbConnectionFactory

Opens a connection for each read.

Methods

FindClientByIdAsync(string, CancellationToken)

Finds a client by id, or returns null if not found.

public Task<Client?> FindClientByIdAsync(string clientId, CancellationToken cancellationToken = default)

Parameters

clientId string
cancellationToken CancellationToken

Returns

Task<Client>

Remarks

Reads the one Clients row whose ClientId matches, ordinal as the database compares it, and deserializes its JSON Data. A miss returns null. The Enabled column is not consulted here; a disabled client comes back with Enabled false for the caller to refuse.

Exceptions

ArgumentException

clientId is null or empty.

GetAllClientsAsync(CancellationToken)

Every client in the table, by client id. Duende's.

public IAsyncEnumerable<Client> GetAllClientsAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

IAsyncEnumerable<Client>

Remarks

Read whole before the first is yielded, so the connection is not held while a caller works through them.