Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class Duende.​IdentityServer.​Services.​DefaultUserSession
Assembly: Duende.IdentityServer
Inheritance: object → DefaultUserSession
Implemented Interfaces
Cookie-based session implementation
Fields and Constants
protected readonly
Microsoft.​AspNetCore.​Http.​IHttpContextAccessor
HttpContextAccessor
The HTTP context accessor
protected readonly
Microsoft.​AspNetCore.​Authentication.​IAuthenticationHandlerProvider
Handlers
The handlers
protected readonly
Configuration.​IdentityServerOptions
Options
The options
protected readonly
System.​TimeProvider
TimeProvider
The time provider
protected readonly
IServerUrls
Urls
The server URL service.
protected readonly
Microsoft.​Extensions.​Logging.​ILogger
Logger
The logger
Principal
The principal
Properties
The properties
Properties
HttpContext
Gets the HTTP context.
protected
string
CheckSessionCookieName
Gets the name of the check session cookie.
protected
string
CheckSessionCookieDomain
Gets the domain of the check session cookie.
CheckSessionCookieSameSiteMode
Gets the SameSite mode of the check session cookie.
Methods
AuthenticateAsync​()
Authenticates the authentication cookie for the current HTTP request and caches the user and properties results.
public
System.​Threading.​Tasks.​Task<​string>
CreateSessionIdAsync​(System.​Security.​Claims.​ClaimsPrincipal principal,
Microsoft.​AspNetCore.​Authentication.​AuthenticationProperties properties,
System.​Threading.​CancellationToken ct)
Creates a session identifier for the signin context and issues the session id cookie.
ct
The cancellation token.
public
System.​Threading.​Tasks.​Task<​System.​Security.​Claims.​ClaimsPrincipal>
GetUserAsync​(System.​Threading.​CancellationToken ct)
Gets the current authenticated user.
ct
The cancellation token.
public
System.​Threading.​Tasks.​Task<​string>
GetSessionIdAsync​(System.​Threading.​CancellationToken ct)
Gets the current session identifier.
ct
The cancellation token.
EnsureSessionIdCookieAsync​(System.​Threading.​CancellationToken ct)
Ensures the session identifier cookie is synchronized with the current
session identifier. If there is no sid, the cookie is removed. If there
is a sid, and the session identifier cookie is missing, it is issued.
ct
The cancellation token.
RemoveSessionIdCookieAsync​(System.​Threading.​CancellationToken ct)
Removes the session identifier cookie.
ct
The cancellation token.
CreateSessionIdCookieOptions​()
Creates the options for the session cookie.
public
void
IssueSessionIdCookie​(string sid)
Issues the cookie that contains the session id.
AddClientIdAsync​(string clientId,
System.​Threading.​CancellationToken ct)
Adds a client to the list of clients the user has signed into during their session.
clientId
The client identifier.
ct
The cancellation token.
public
System.​Threading.​Tasks.​Task<​System.​Collections.​Generic.​IEnumerable<​string>>
GetClientListAsync​(System.​Threading.​CancellationToken ct)
Gets the list of clients the user has signed into during their session.
ct
The cancellation token.
AddSamlSessionAsync​(Saml.​Models.​SamlSpSessionData session,
System.​Threading.​CancellationToken ct)
public
System.​Threading.​Tasks.​Task<​System.​Collections.​Generic.​IEnumerable<​Saml.​Models.​SamlSpSessionData>>
GetSamlSessionListAsync​(System.​Threading.​CancellationToken ct)
RemoveSamlSessionAsync​(string entityId,
System.​Threading.​CancellationToken ct)
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object