Table of Contents

Class FileTicketStore

Namespace
Arc4u.OAuth2.TicketStore
Assembly
Arc4u.OAuth2.AspNetCore.Authentication.dll

An ITicketStore that keeps each authentication ticket in a file ({guid}.bin) of the directory configured in StorePath. It is meant for a single instance application.

public class FileTicketStore : ITicketStore
Inheritance
FileTicketStore
Implements
Inherited Members

Constructors

FileTicketStore(ILogger<FileTicketStore>, IOptionsMonitor<FileTicketStoreOptions>)

Initializes a new instance of the FileTicketStore class.

public FileTicketStore(ILogger<FileTicketStore> logger, IOptionsMonitor<FileTicketStoreOptions> options)

Parameters

logger ILogger<FileTicketStore>

The logger.

options IOptionsMonitor<FileTicketStoreOptions>

The options giving the directory of the tickets.

Exceptions

ArgumentNullException

The store path is null.

Methods

RemoveAsync(string)

Remove the identity associated with the given key.

public Task RemoveAsync(string key)

Parameters

key string

The key associated with the identity.

Returns

Task

RenewAsync(string, AuthenticationTicket)

Tells the store that the given identity should be updated.

public Task RenewAsync(string key, AuthenticationTicket ticket)

Parameters

key string
ticket AuthenticationTicket

Returns

Task

RetrieveAsync(string)

Retrieves an identity from the store for the given key.

public Task<AuthenticationTicket?> RetrieveAsync(string key)

Parameters

key string

The key associated with the identity.

Returns

Task<AuthenticationTicket>

The identity associated with the given key, or null if not found.

StoreAsync(AuthenticationTicket)

Store the identity ticket and return the associated key.

public Task<string> StoreAsync(AuthenticationTicket ticket)

Parameters

ticket AuthenticationTicket

The identity information to store.

Returns

Task<string>

The key that can be used to retrieve the identity later.