Class BackOfficeSignInManager
The sign in manager for back office users
Namespace: Umbraco.Cms.Api.Management.Security
Assembly: Umbraco.Cms.Api.Management.dll
Syntax
public class BackOfficeSignInManager : UmbracoSignInManager<BackOfficeIdentityUser>, IBackOfficeSignInManager, ICoreBackOfficeSignInManager
Constructors
View SourceBackOfficeSignInManager(BackOfficeUserManager, IHttpContextAccessor, IBackOfficeExternalLoginProviders, IUserClaimsPrincipalFactory<BackOfficeIdentityUser>, IOptions<IdentityOptions>, IOptions<GlobalSettings>, ILogger<SignInManager<BackOfficeIdentityUser>>, IAuthenticationSchemeProvider, IUserConfirmation<BackOfficeIdentityUser>, IEventAggregator, IOptions<SecuritySettings>, IOptions<BackOfficeAuthenticationTypeSettings>, IRequestCache)
Initializes a new instance of the BackOfficeSignInManager class.
Declaration
public BackOfficeSignInManager(BackOfficeUserManager userManager, IHttpContextAccessor contextAccessor, IBackOfficeExternalLoginProviders externalLogins, IUserClaimsPrincipalFactory<BackOfficeIdentityUser> claimsFactory, IOptions<IdentityOptions> optionsAccessor, IOptions<GlobalSettings> globalSettings, ILogger<SignInManager<BackOfficeIdentityUser>> logger, IAuthenticationSchemeProvider schemes, IUserConfirmation<BackOfficeIdentityUser> confirmation, IEventAggregator eventAggregator, IOptions<SecuritySettings> securitySettings, IOptions<BackOfficeAuthenticationTypeSettings> backOfficeAuthenticationTypeSettings, IRequestCache requestCache)
Parameters
| Type | Name | Description |
|---|---|---|
| BackOfficeUserManager | userManager | The BackOfficeUserManager responsible for managing back office users. |
| IHttpContextAccessor | contextAccessor | The Microsoft.AspNetCore.Http.IHttpContextAccessor used to access the current HTTP context. |
| IBackOfficeExternalLoginProviders | externalLogins | The IBackOfficeExternalLoginProviders for handling external login providers. |
| IUserClaimsPrincipalFactory<BackOfficeIdentityUser> | claimsFactory | The Microsoft.AspNetCore.Identity.IUserClaimsPrincipalFactory<TUser> for creating claims principals. |
| IOptions<IdentityOptions> | optionsAccessor | The Microsoft.Extensions.Options.IOptions<TOptions> accessor for identity options. |
| IOptions<GlobalSettings> | globalSettings | The Microsoft.Extensions.Options.IOptions<TOptions> accessor for global settings. |
| ILogger<SignInManager<BackOfficeIdentityUser>> | logger | The ILogger<SignInManager<BackOfficeIdentityUser>> instance for logging. |
| IAuthenticationSchemeProvider | schemes | The Microsoft.AspNetCore.Authentication.IAuthenticationSchemeProvider for authentication schemes. |
| IUserConfirmation<BackOfficeIdentityUser> | confirmation | The Microsoft.AspNetCore.Identity.IUserConfirmation<TUser> service for user confirmation. |
| IEventAggregator | eventAggregator | The IEventAggregator for publishing and subscribing to events. |
| IOptions<SecuritySettings> | securitySettings | The Microsoft.Extensions.Options.IOptions<TOptions> accessor for security settings. |
| IOptions<BackOfficeAuthenticationTypeSettings> | backOfficeAuthenticationTypeSettings | The Microsoft.Extensions.Options.IOptions<TOptions> accessor for back office authentication type settings. |
| IRequestCache | requestCache | The IRequestCache for caching request data. |
Properties
View SourceAllowConcurrentLoginsEnabled
Declaration
protected override bool AllowConcurrentLoginsEnabled { get; }
Property Value
| Type | Description |
|---|---|
| bool |
AuthenticationType
Declaration
protected override string AuthenticationType { get; }
Property Value
| Type | Description |
|---|---|
| string |
ExternalAuthenticationType
Declaration
protected override string ExternalAuthenticationType { get; }
Property Value
| Type | Description |
|---|---|
| string |
TwoFactorAuthenticationType
Declaration
protected override string TwoFactorAuthenticationType { get; }
Property Value
| Type | Description |
|---|---|
| string |
TwoFactorRememberMeAuthenticationType
Declaration
protected override string TwoFactorRememberMeAuthenticationType { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
View SourceConfigureExternalAuthenticationProperties(string?, string?, string?)
Configures the redirect URL and user identifier for the specified external login provider.
Declaration
public override AuthenticationProperties ConfigureExternalAuthenticationProperties(string? provider, string? redirectUrl, string? userId = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | provider | The provider to configure. |
| string | redirectUrl | The external login URL users should be redirected to during the login flow. |
| string | userId | The current user's identifier, which will be used to provide CSRF protection. |
Returns
| Type | Description |
|---|---|
| AuthenticationProperties | A configured Microsoft.AspNetCore.Authentication.AuthenticationProperties. |
ExternalLoginSignInAsync(ExternalLoginInfo, bool, bool)
Custom ExternalLoginSignInAsync overload for handling external sign in with auto-linking
Declaration
public Task<SignInResult> ExternalLoginSignInAsync(ExternalLoginInfo loginInfo, bool isPersistent, bool bypassTwoFactor = false)
Parameters
| Type | Name | Description |
|---|---|---|
| ExternalLoginInfo | loginInfo | The external login information. |
| bool | isPersistent | Whether the sign-in should be persistent. |
| bool | bypassTwoFactor | Whether to bypass two-factor authentication. |
Returns
| Type | Description |
|---|---|
| Task<SignInResult> | The sign-in result. |
GetExternalAuthenticationSchemesAsync()
Gets the external authentication schemes available for back office sign-in.
Declaration
public override Task<IEnumerable<AuthenticationScheme>> GetExternalAuthenticationSchemesAsync()
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<AuthenticationScheme>> | A task that represents the asynchronous operation. The task result contains a collection of external authentication schemes. |
HandleSignIn(BackOfficeIdentityUser?, string?, SignInResult)
Overridden to deal with events/notificiations
Declaration
protected override Task<SignInResult> HandleSignIn(BackOfficeIdentityUser? user, string? username, SignInResult result)
Parameters
| Type | Name | Description |
|---|---|---|
| BackOfficeIdentityUser | user | The user being signed in. |
| string | username | The username. |
| SignInResult | result | The sign-in result from the base implementation. |
Returns
| Type | Description |
|---|---|
| Task<SignInResult> | The sign-in result after handling notifications. |
NotifyRequiresTwoFactor(BackOfficeIdentityUser)
Declaration
protected void NotifyRequiresTwoFactor(BackOfficeIdentityUser user)
Parameters
| Type | Name | Description |
|---|---|---|
| BackOfficeIdentityUser | user |
SignInOrTwoFactorAsync(BackOfficeIdentityUser, bool, string?, bool)
Declaration
protected override Task<SignInResult> SignInOrTwoFactorAsync(BackOfficeIdentityUser user, bool isPersistent, string? loginProvider = null, bool bypassTwoFactor = false)
Parameters
| Type | Name | Description |
|---|---|---|
| BackOfficeIdentityUser | user | |
| bool | isPersistent | |
| string | loginProvider | |
| bool | bypassTwoFactor |
Returns
| Type | Description |
|---|---|
| Task<SignInResult> |