Table of Contents

Class DefaultSignOutService

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 sealed class DefaultSignOutService : ISignOutService
Inheritance
DefaultSignOutService
Implements
Inherited Members

Constructors

DefaultSignOutService(ILogoutNotificationContextFactory, IBackChannelLogoutService, ISessionStateService, IEventService, IUserSession?, IClientStore?, IPersistedGrantStore?, IOptions<IdentityServerOptions>?)

Creates the service, as the container resolves it.

public DefaultSignOutService(ILogoutNotificationContextFactory notificationContexts, IBackChannelLogoutService backChannelLogout, ISessionStateService sessionState, IEventService events, IUserSession? userSession = null, IClientStore? clients = null, IPersistedGrantStore? grants = null, IOptions<IdentityServerOptions>? options = null)

Parameters

notificationContexts ILogoutNotificationContextFactory

Reads the logout id as the session's clients to notify.

backChannelLogout IBackChannelLogoutService

Tells those clients, server to server, that the session ended.

sessionState ISessionStateService

Clears the browser state, so every check-session poll sees a change.

events IEventService

Receives the UserLogoutSuccessEvent, and a GrantsRevokedEvent for each coordinating client.

userSession IUserSession

The session's client list, read before the cookie goes; null revokes no coordinated tokens.

clients IClientStore

Says which of those clients coordinate their tokens with the session; null revokes none.

grants IPersistedGrantStore

Where a coordinating client's session tokens are removed from; null removes none.

options IOptions<IdentityServerOptions>

The server options; whether every client coordinates with the session.

Methods

SignOutAsync(HttpContext, string?, CancellationToken)

Ends the session in the browser, then notifies the clients named by logoutId.

public Task<string?> SignOutAsync(HttpContext context, string? logoutId, CancellationToken cancellationToken = default)

Parameters

context HttpContext

The request whose session is ending.

logoutId string

A logout id created before the session ends. It is the only place the session's client list survives sign-out, so a caller that creates it afterwards has nobody to notify — which is not an error this can report, because a session that reached no client looks the same.

cancellationToken CancellationToken

Cancels the notification, not the sign-out.

Returns

Task<string>

The external authentication scheme this sign-out still has to be carried to, or null when there is none. A session established through an upstream provider is not over while that provider's session is live: the user clicks sign in and is returned without being asked anything. Ending it needs the browser, so it cannot happen inside this call — the caller owns where the browser goes next, and this says whether it has somewhere to go first.

Exceptions

ArgumentNullException

context is null.