Table of Contents

Interface IUserSession

Namespace
Duende.IdentityServer.Services
Assembly
Duende.IdentityServer.dll

Models a user's authentication session

public interface IUserSession

Methods

AddClientIdAsync(string)

Adds a client to the list of clients the user has signed into during their session.

Task AddClientIdAsync(string clientId)

Parameters

clientId string

The client identifier.

Returns

Task

CreateSessionIdAsync(ClaimsPrincipal, AuthenticationProperties)

Creates a session identifier for the signin context and issues the session id cookie.

Task<string> CreateSessionIdAsync(ClaimsPrincipal principal, AuthenticationProperties properties)

Parameters

principal ClaimsPrincipal
properties AuthenticationProperties

Returns

Task<string>

EnsureSessionIdCookieAsync()

Ensures the session identifier cookie asynchronous.

Task EnsureSessionIdCookieAsync()

Returns

Task

GetClientListAsync()

Gets the list of clients the user has signed into during their session.

Task<IEnumerable<string>> GetClientListAsync()

Returns

Task<IEnumerable<string>>

GetSessionIdAsync()

Gets the current session identifier.

Task<string?> GetSessionIdAsync()

Returns

Task<string>

GetUserAsync()

Gets the current authenticated user.

Task<ClaimsPrincipal?> GetUserAsync()

Returns

Task<ClaimsPrincipal>

RemoveSessionIdCookieAsync()

Removes the session identifier cookie.

Task RemoveSessionIdCookieAsync()

Returns

Task