Interface IAppPrincipalFactory
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
settingsIKeyValueSettingsThe settings describing how the token is obtained.
parameterobjectAn 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
parameterobjectAn 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
settingsResolveNamestringThe name (key) under which the IKeyValueSettings are registered.
parameterobjectAn 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
settingsIKeyValueSettingsThe settings describing the identity provider.
cancellationTokenCancellationTokenA 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
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- ValueTask
A task that completes when the user is signed out.