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.
interface Duende.​IdentityServer.​Services.​IUserSession
Assembly: Duende.IdentityServer
Models a user's authentication session
Methods
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.
System.​Threading.​Tasks.​Task<​System.​Security.​Claims.​ClaimsPrincipal>
GetUserAsync​(System.​Threading.​CancellationToken ct)
Gets the current authenticated user.
ct
The cancellation token.
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 asynchronously.
ct
The cancellation token.
RemoveSessionIdCookieAsync​(System.​Threading.​CancellationToken ct)
Removes the session identifier cookie.
ct
The cancellation token.
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.
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)
Adds a SAML SP session to the user's session.
session
The SAML session data.
ct
The cancellation token.
Remarks
Session data is stored in AuthenticationProperties. For deployments with many SAML service providers,
server-side sessions should be enabled to avoid cookie size limitations.
See <see cref="T:Duende.IdentityServer.Saml.Models.SamlSpSessionData" /> for details.
System.​Threading.​Tasks.​Task<​System.​Collections.​Generic.​IEnumerable<​Saml.​Models.​SamlSpSessionData>>
GetSamlSessionListAsync​(System.​Threading.​CancellationToken ct)
Gets the list of SAML SP sessions for the user's session.
ct
The cancellation token.
RemoveSamlSessionAsync​(string entityId,
System.​Threading.​CancellationToken ct)
Removes a SAML SP session by EntityId.
entityId
The SP's entity ID.
ct
The cancellation token.