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)
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 | |
| 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 |
Properties
View SourceAuthenticationType
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 | |
| bool | isPersistent | |
| bool | bypassTwoFactor |
Returns
| Type | Description |
|---|---|
| Task<SignInResult> |
GetExternalAuthenticationSchemesAsync()
Gets a collection of Microsoft.AspNetCore.Authentication.AuthenticationSchemes for the known external login providers.
Declaration
public override Task<IEnumerable<AuthenticationScheme>> GetExternalAuthenticationSchemesAsync()
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<AuthenticationScheme>> | A collection of Microsoft.AspNetCore.Authentication.AuthenticationSchemes for the known external login providers. |
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 | |
| string | username | |
| SignInResult | result |
Returns
| Type | Description |
|---|---|
| Task<SignInResult> |
NotifyRequiresTwoFactor(BackOfficeIdentityUser)
Declaration
protected void NotifyRequiresTwoFactor(BackOfficeIdentityUser user)
Parameters
| Type | Name | Description |
|---|---|---|
| BackOfficeIdentityUser | user |
SignInOrTwoFactorAsync(BackOfficeIdentityUser, bool, string?, bool)
Signs in the specified user if bypassTwoFactor is set to false.
Otherwise stores the user for use after a two factor check.
Declaration
protected override Task<SignInResult> SignInOrTwoFactorAsync(BackOfficeIdentityUser user, bool isPersistent, string? loginProvider = null, bool bypassTwoFactor = false)
Parameters
| Type | Name | Description |
|---|---|---|
| BackOfficeIdentityUser | user | |
| bool | isPersistent | Flag indicating whether the sign-in cookie should persist after the browser is closed. |
| string | loginProvider | The login provider to use. Default is null |
| bool | bypassTwoFactor | Flag indicating whether to bypass two factor authentication. Default is false |
Returns
| Type | Description |
|---|---|
| Task<SignInResult> | Returns a Microsoft.AspNetCore.Identity.SignInResult |