ISessionClientRegistry Interface
Records which clients signed in to an authentication session, so the clients can be told when it ends.
public interface ISessionClientRegistryDerived
↳ SessionClientRegistry
Remarks
Kept on the server rather than in the session. A session travels in the user's cookie, and a browser that authorizes two clients at once sends both requests with the same cookie, so a list inside it can only ever hold the client of whichever response arrived last.
Replace the default when the backing store offers an atomic set addition across nodes. The default claims one storage key per client through TrySetIfAbsentAsync<T>(string, T, StorageOptions, Nullable<CancellationToken>), so between concurrent authorizations it is as exact as the storage's implementation of that call. It also relies on the storage keeping an entry until its expiry: an entry dropped earlier ends the list a logout reads at that point.
Methods
ISessionClientRegistry.AddClientAsync(TenantDefinition, string, string, CancellationToken) Method
Records that a client signed in to a session, and keeps the clients recorded for the session readable for at least SessionClientsRetention from now. Recording a client already recorded lists it no second time.
System.Threading.Tasks.Task AddClientAsync(Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition tenant, string sessionId, string clientId, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
tenant TenantDefinition
The tenant the session belongs to.
sessionId System.String
The session the client signed in to.
clientId System.String
The client.
cancellationToken System.Threading.CancellationToken
Cancels the operation.
Returns
Remarks
A session goes on under its id when its end user signs in again, so an implementation that let the list expire a fixed time after its first client would end a long session without telling the clients that signed in to it early.
ISessionClientRegistry.GetClientsAsync(TenantDefinition, string, CancellationToken) Method
The clients recorded for a session, each once.
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<string>> GetClientsAsync(Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition tenant, string sessionId, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
tenant TenantDefinition
The tenant the session belongs to.
sessionId System.String
The session.
cancellationToken System.Threading.CancellationToken
Cancels the lookup.
Returns
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<System.String>>
The recorded client identifiers; empty when none are recorded or the records have expired.