Table of Contents

Interface IAppPrincipalFactory

Namespace
Arc4u.Security.Principal
Assembly
Arc4u.dll

Creates (and signs out) the AppPrincipal of the user, based on a token obtained with settings resolved from the dependency injection container.

public interface IAppPrincipalFactory

Methods

CreatePrincipalAsync(IKeyValueSettings, object?)

Creates the principal using the specified settings.

Task<Result<AppPrincipal>> CreatePrincipalAsync(IKeyValueSettings settings, object? parameter = null)

Parameters

settings IKeyValueSettings

The settings describing how the token is obtained.

parameter object

An optional parameter passed to the token provider.

Returns

Task<Result<AppPrincipal>>

A result containing the principal, or the reasons why it could not be created.

CreatePrincipalAsync(object?)

Creates the principal using the default settings of the implementation.

Task<Result<AppPrincipal>> CreatePrincipalAsync(object? parameter = null)

Parameters

parameter object

An optional parameter passed to the token provider (for example platform specific parameters).

Returns

Task<Result<AppPrincipal>>

A result containing the principal, or the reasons why it could not be created.

CreatePrincipalAsync(string, object?)

Creates the principal using the settings registered under the specified name.

Task<Result<AppPrincipal>> CreatePrincipalAsync(string settingsResolveName, object? parameter = null)

Parameters

settingsResolveName string

The name (key) under which the IKeyValueSettings are registered.

parameter object

An optional parameter passed to the token provider.

Returns

Task<Result<AppPrincipal>>

A result containing the principal, or the reasons why it could not be created (for example when no settings exist with that name).

SignOutUserAsync(IKeyValueSettings, CancellationToken)

Signs out the user using the specified settings.

ValueTask SignOutUserAsync(IKeyValueSettings settings, CancellationToken cancellationToken)

Parameters

settings IKeyValueSettings

The settings describing the identity provider.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

ValueTask

A task that completes when the user is signed out.

SignOutUserAsync(CancellationToken)

Signs out the user using the default settings of the implementation.

ValueTask SignOutUserAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

A token to cancel the operation.

Returns

ValueTask

A task that completes when the user is signed out.