Skip to content

LogoutConfirmationStore Class

Keeps the question a session currently has outstanding in the server's entity storage, under the session's own key, so that asking again is the same question rather than another one.

C#
public sealed class LogoutConfirmationStore : Abblix.Oidc.Server.Features.LogoutNotification.ILogoutConfirmationStore

Inheritance System.Object → LogoutConfirmationStore

Implements ILogoutConfirmationStore

Constructors

LogoutConfirmationStore(IEntityStorage, IEntityStorageKeyFactory, IOptions<OidcOptions>) Constructor

Keeps the question a session currently has outstanding in the server's entity storage, under the session's own key, so that asking again is the same question rather than another one.

C#
public LogoutConfirmationStore(Abblix.Oidc.Server.Features.Storages.IEntityStorage storage, Abblix.Oidc.Server.Features.Storages.IEntityStorageKeyFactory keyFactory, Microsoft.Extensions.Options.IOptions<Abblix.Oidc.Server.Common.Configuration.OidcOptions> options);

Parameters

storage IEntityStorage

Where the outstanding question is kept.

keyFactory IEntityStorageKeyFactory

Names the storage key a session's question is kept under.

options Microsoft.Extensions.Options.IOptions<OidcOptions>

Source of the value's length and of how long a question stays good for.

Methods

LogoutConfirmationStore.IssueAsync(TenantDefinition, string) Method

Issues the value that answers for sessionId, to be rendered into the page that asks the end user and sent back with their answer. A session has one outstanding question at a time: asking again while it stands answers with the same value, so a request arriving while the end user reads the page cannot void the answer they are about to give. Two first requests for one session that overlap are given the same value too: the value is written only where the session has none, which the entity storage decides. The default storage decides within one process only; across several nodes only an IEntityStorage built on the store's own primitive, such as Redis SET NX or a unique-key insert, does.

C#
public System.Threading.Tasks.Task<string> IssueAsync(Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition tenant, string sessionId);

Parameters

tenant TenantDefinition

The tenant the session belongs to.

sessionId System.String

The session the end user is being asked about.

Implements IssueAsync(TenantDefinition, string)

Returns

System.Threading.Tasks.Task<System.String>
The value, unguessable and good until it is answered or expires.

LogoutConfirmationStore.RedeemLogoutConfirmationAsync(TenantDefinition, string, string) Method

Answers whether confirmation is the value sessionId was asked with, and spends the question when it is, so a value captured from a page stops being an answer once it has been given. Two identical answers arriving together can both be told they took it; each of them asked to end the same session, which is what happens.

C#
public System.Threading.Tasks.Task<bool> RedeemLogoutConfirmationAsync(Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition tenant, string sessionId, string confirmation);

Parameters

tenant TenantDefinition

The tenant the session belongs to.

sessionId System.String

The session the request would end.

confirmation System.String

The value the request presented.

Implements RedeemLogoutConfirmationAsync(TenantDefinition, string, string)

Returns

System.Threading.Tasks.Task<System.Boolean>
true when the end user answered this session's question; false when that session has no question outstanding, when the question has expired or been answered already, and when the value is not the one it was asked with.

Remarks

Every false means the same thing to the caller, which is what makes this seam usable at all: the end user is asked again, and a fresh question replaces whatever stood before. A logout that asks twice costs a click; one that acts on an answer somebody else's browser gave, or on one already spent, costs the session.