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
notificationContextsILogoutNotificationContextFactoryReads the logout id as the session's clients to notify.
backChannelLogoutIBackChannelLogoutServiceTells those clients, server to server, that the session ended.
sessionStateISessionStateServiceClears the browser state, so every check-session poll sees a change.
eventsIEventServiceReceives the UserLogoutSuccessEvent, and a GrantsRevokedEvent for each coordinating client.
userSessionIUserSessionThe session's client list, read before the cookie goes; null revokes no coordinated tokens.
clientsIClientStoreSays which of those clients coordinate their tokens with the session; null revokes none.
grantsIPersistedGrantStoreWhere a coordinating client's session tokens are removed from; null removes none.
optionsIOptions<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
contextHttpContextThe request whose session is ending.
logoutIdstringA 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.
cancellationTokenCancellationTokenCancels 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
contextis null.