Table of Contents

Class DefaultSessionManagementService

Namespace
Fdyay.IdentityServer.Services
Assembly
Fdyay.IdentityServer.AspNetCore.dll

Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.

public class DefaultSessionManagementService : ISessionManagementService
Inheritance
DefaultSessionManagementService
Implements
Inherited Members

Constructors

DefaultSessionManagementService(IServerSideSessionStore, ISessionCoordinationService, IEventService)

The constructor before 0.162.0: ends sessions by filter, and refuses a RemoveSessionsContext.

public DefaultSessionManagementService(IServerSideSessionStore store, ISessionCoordinationService coordination, IEventService events)

Parameters

store IServerSideSessionStore

The server-side sessions, queried and deleted.

coordination ISessionCoordinationService

Cleans up after each ended session: its clients told, its grants removed.

events IEventService

Receives a SessionRevokedEvent for each ended session.

DefaultSessionManagementService(IServerSideSessionStore, ISessionCoordinationService, IEventService, IServerSideTicketStore, IPersistedGrantStore, IBackChannelLogoutService)

public DefaultSessionManagementService(IServerSideSessionStore store, ISessionCoordinationService coordination, IEventService events, IServerSideTicketStore tickets, IPersistedGrantStore grants, IBackChannelLogoutService backChannelLogout)

Parameters

store IServerSideSessionStore
coordination ISessionCoordinationService
events IEventService
tickets IServerSideTicketStore
grants IPersistedGrantStore
backChannelLogout IBackChannelLogoutService

Remarks

The one the container chooses since 0.162.0. A service built with the constructor above, as one written before was, ends sessions by filter as it did and refuses a context.

Methods

QuerySessionsAsync(SessionQuery, CancellationToken)

A page of sessions, for an administrative list.

public Task<QueryResult<ServerSideSession>> QuerySessionsAsync(SessionQuery query, CancellationToken cancellationToken = default)

Parameters

query SessionQuery
cancellationToken CancellationToken

Returns

Task<QueryResult<ServerSideSession>>

RemoveSessionsAsync(RemoveSessionsContext, CancellationToken)

Ends the sessions the context names and, as its flags say, tells their clients and revokes the clients' tokens and consents. Duende's.

public Task RemoveSessionsAsync(RemoveSessionsContext context, CancellationToken cancellationToken = default)

Parameters

context RemoveSessionsContext
cancellationToken CancellationToken

Returns

Task

Remarks

An overload beside RemoveSessionsAsync(SessionFilter, CancellationToken), which keeps doing what it did. A default interface method, so a host's service written before 0.162.0 keeps compiling; one that does not implement it throws NotSupportedException when asked, rather than ending less than it was asked to. Nothing in Duende's assembly or this server calls it; it is for a host's administrative page. Duende's interface has no default.

RemoveSessionsAsync(SessionFilter, CancellationToken)

Ends every session matching the filter, and cleans up after each.

public Task RemoveSessionsAsync(SessionFilter filter, CancellationToken cancellationToken = default)

Parameters

filter SessionFilter
cancellationToken CancellationToken

Returns

Task

Remarks

The matching sessions are read, then deleted; then for each a SessionRevokedEvent is raised and the coordination service cleans up after it.