Class InMemorySamlLogoutSessionStore
- Namespace
- Fdyay.IdentityServer.Saml.Stores
- Assembly
- Fdyay.IdentityServer.Saml.dll
In-memory logout session store. Intended for development and single-instance hosting.
public sealed class InMemorySamlLogoutSessionStore : ISamlLogoutSessionStore
- Inheritance
-
InMemorySamlLogoutSessionStore
- Implements
- Inherited Members
Remarks
Swept on read rather than on a timer, exactly as the sign-in state store is: a sequence nobody came back to finish costs the memory it occupies and nothing else, and a host that wants a bounded store provides one.
Constructors
InMemorySamlLogoutSessionStore(TimeProvider)
Creates an empty store.
public InMemorySamlLogoutSessionStore(TimeProvider time)
Parameters
timeTimeProviderThe clock expiry is judged against.
Fields
Lifetime
How long a sequence written without an ExpiresAt may take before it is dropped.
public static readonly TimeSpan Lifetime
Field Value
Remarks
Until 0.145.0 every sequence was held to this; the endpoint now writes each one's expiry from
SamlOptions.LogoutSessionLifetime.
Shorter than a sign-in's, because a logout sequence is hops through a browser that is already waiting
rather than a person typing a password.
Methods
StoreAsync(string, SamlLogoutSession, CancellationToken)
Stores session under key, an opaque reference.
public Task StoreAsync(string key, SamlLogoutSession session, CancellationToken cancellationToken = default)
Parameters
keystringsessionSamlLogoutSessioncancellationTokenCancellationToken
Returns
Remarks
Replaces any sequence already under key.
Exceptions
- ArgumentException
keyis null or empty.- ArgumentNullException
sessionis null.
TakeAsync(string, CancellationToken)
Atomically removes and returns the sequence for key, or null if absent.
public Task<SamlLogoutSession?> TakeAsync(string key, CancellationToken cancellationToken = default)
Parameters
keystringcancellationTokenCancellationToken
Returns
Remarks
Drops every expired sequence first, so an expired one is absent.
Exceptions
- ArgumentException
keyis null or empty.