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
stringThe client identifier.
Returns
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
ClaimsPrincipalproperties
AuthenticationProperties
Returns
EnsureSessionIdCookieAsync()
Ensures the session identifier cookie asynchronous.
Task EnsureSessionIdCookieAsync()
Returns
GetClientListAsync()
Gets the list of clients the user has signed into during their session.
Task<IEnumerable<string>> GetClientListAsync()
Returns
GetSessionIdAsync()
Gets the current session identifier.
Task<string?> GetSessionIdAsync()
Returns
GetUserAsync()
Gets the current authenticated user.
Task<ClaimsPrincipal?> GetUserAsync()
Returns
RemoveSessionIdCookieAsync()
Removes the session identifier cookie.
Task RemoveSessionIdCookieAsync()