Search Results for

    Show / Hide Table of Contents
    View Source

    Class BackOfficeUserManager

    Inheritance
    object
    UserManager<BackOfficeIdentityUser>
    UmbracoUserManager<BackOfficeIdentityUser, UserPasswordConfigurationSettings>
    Namespace: Umbraco.Cms.Web.Common.Security
    Assembly: Umbraco.Web.Common.dll
    Syntax
    public class BackOfficeUserManager : UmbracoUserManager<BackOfficeIdentityUser, UserPasswordConfigurationSettings>, IBackOfficeUserManager, IUmbracoUserManager<BackOfficeIdentityUser>, ICoreBackOfficeUserManager

    Constructors

    View Source

    BackOfficeUserManager(IIpResolver, IUserStore<BackOfficeIdentityUser>, IOptions<BackOfficeIdentityOptions>, IPasswordHasher<BackOfficeIdentityUser>, IEnumerable<IUserValidator<BackOfficeIdentityUser>>, IEnumerable<IPasswordValidator<BackOfficeIdentityUser>>, BackOfficeErrorDescriber, IServiceProvider, IHttpContextAccessor, ILogger<UserManager<BackOfficeIdentityUser>>, IOptions<UserPasswordConfigurationSettings>, IEventAggregator, IBackOfficeUserPasswordChecker, IOptions<GlobalSettings>)

    Declaration
    public BackOfficeUserManager(IIpResolver ipResolver, IUserStore<BackOfficeIdentityUser> store, IOptions<BackOfficeIdentityOptions> optionsAccessor, IPasswordHasher<BackOfficeIdentityUser> passwordHasher, IEnumerable<IUserValidator<BackOfficeIdentityUser>> userValidators, IEnumerable<IPasswordValidator<BackOfficeIdentityUser>> passwordValidators, BackOfficeErrorDescriber errors, IServiceProvider services, IHttpContextAccessor httpContextAccessor, ILogger<UserManager<BackOfficeIdentityUser>> logger, IOptions<UserPasswordConfigurationSettings> passwordConfiguration, IEventAggregator eventAggregator, IBackOfficeUserPasswordChecker backOfficeUserPasswordChecker, IOptions<GlobalSettings> globalSettings)
    Parameters
    Type Name Description
    IIpResolver ipResolver
    IUserStore<BackOfficeIdentityUser> store
    IOptions<BackOfficeIdentityOptions> optionsAccessor
    IPasswordHasher<BackOfficeIdentityUser> passwordHasher
    IEnumerable<IUserValidator<BackOfficeIdentityUser>> userValidators
    IEnumerable<IPasswordValidator<BackOfficeIdentityUser>> passwordValidators
    BackOfficeErrorDescriber errors
    IServiceProvider services
    IHttpContextAccessor httpContextAccessor
    ILogger<UserManager<BackOfficeIdentityUser>> logger
    IOptions<UserPasswordConfigurationSettings> passwordConfiguration
    IEventAggregator eventAggregator
    IBackOfficeUserPasswordChecker backOfficeUserPasswordChecker
    IOptions<GlobalSettings> globalSettings

    Methods

    View Source

    AccessFailedAsync(BackOfficeIdentityUser)

    Overrides the Microsoft ASP.NET user management method

    Declaration
    public override Task<IdentityResult> AccessFailedAsync(BackOfficeIdentityUser user)
    Parameters
    Type Name Description
    BackOfficeIdentityUser user

    The user whose failed access count to increment.

    Returns
    Type Description
    Task<IdentityResult>

    The System.Threading.Tasks.Task that represents the asynchronous operation, containing the Microsoft.AspNetCore.Identity.IdentityResult of the operation.

    View Source

    ChangePasswordAsync(BackOfficeIdentityUser, string, string)

    Changes a user's password after confirming the specified currentPassword is correct, as an asynchronous operation.

    Declaration
    public override Task<IdentityResult> ChangePasswordAsync(BackOfficeIdentityUser user, string currentPassword, string newPassword)
    Parameters
    Type Name Description
    BackOfficeIdentityUser user

    The user whose password should be set.

    string currentPassword

    The current password to validate before changing.

    string newPassword

    The new password to set for the specified user.

    Returns
    Type Description
    Task<IdentityResult>

    The System.Threading.Tasks.Task that represents the asynchronous operation, containing the Microsoft.AspNetCore.Identity.IdentityResult of the operation.

    View Source

    ChangePasswordWithResetAsync(string, string, string)

    This is a special method that will reset the password but will raise the Password Changed event instead of the reset event

    Declaration
    public override Task<IdentityResult> ChangePasswordWithResetAsync(string userId, string token, string newPassword)
    Parameters
    Type Name Description
    string userId

    The userId

    string token

    The reset password token

    string newPassword

    The new password to set it to

    Returns
    Type Description
    Task<IdentityResult>

    The Microsoft.AspNetCore.Identity.IdentityResult

    Remarks

    We use this because in the back office the only way an admin can change another user's password without first knowing their password is to generate a token and reset it, however, when we do this we want to track a password change, not a password reset

    View Source

    CreateAsync(UserCreateModel)

    Declaration
    public Task<IdentityCreationResult> CreateAsync(UserCreateModel createModel)
    Parameters
    Type Name Description
    UserCreateModel createModel
    Returns
    Type Description
    Task<IdentityCreationResult>
    View Source

    CreateForInvite(UserCreateModel)

    Creates a user for an invite. This means that the password will not be populated with

    Declaration
    public Task<IdentityCreationResult> CreateForInvite(UserCreateModel createModel)
    Parameters
    Type Name Description
    UserCreateModel createModel
    Returns
    Type Description
    Task<IdentityCreationResult>
    View Source

    GenerateEmailConfirmationTokenAsync(IUser)

    Declaration
    public Task<Attempt<string, UserOperationStatus>> GenerateEmailConfirmationTokenAsync(IUser user)
    Parameters
    Type Name Description
    IUser user
    Returns
    Type Description
    Task<Attempt<string, UserOperationStatus>>
    View Source

    GeneratePasswordResetTokenAsync(IUser)

    Declaration
    public Task<Attempt<string, UserOperationStatus>> GeneratePasswordResetTokenAsync(IUser user)
    Parameters
    Type Name Description
    IUser user
    Returns
    Type Description
    Task<Attempt<string, UserOperationStatus>>
    View Source

    GetLoginsAsync(IUser)

    Declaration
    public Task<Attempt<ICollection<IIdentityUserLogin>, UserOperationStatus>> GetLoginsAsync(IUser user)
    Parameters
    Type Name Description
    IUser user
    Returns
    Type Description
    Task<Attempt<ICollection<IIdentityUserLogin>, UserOperationStatus>>
    View Source

    IsEmailConfirmationTokenValidAsync(IUser, string)

    Declaration
    public Task<bool> IsEmailConfirmationTokenValidAsync(IUser user, string token)
    Parameters
    Type Name Description
    IUser user
    string token
    Returns
    Type Description
    Task<bool>
    View Source

    IsResetPasswordTokenValidAsync(IUser, string)

    Declaration
    public Task<bool> IsResetPasswordTokenValidAsync(IUser user, string token)
    Parameters
    Type Name Description
    IUser user
    string token
    Returns
    Type Description
    Task<bool>
    View Source

    NotifyAccountLocked(IPrincipal?, string?)

    Declaration
    public void NotifyAccountLocked(IPrincipal? currentUser, string? userId)
    Parameters
    Type Name Description
    IPrincipal currentUser
    string userId
    View Source

    NotifyAccountUnlocked(IPrincipal?, string)

    Declaration
    public void NotifyAccountUnlocked(IPrincipal? currentUser, string userId)
    Parameters
    Type Name Description
    IPrincipal currentUser
    string userId
    View Source

    NotifyForgotPasswordChanged(IPrincipal, string)

    Declaration
    public void NotifyForgotPasswordChanged(IPrincipal currentUser, string userId)
    Parameters
    Type Name Description
    IPrincipal currentUser
    string userId
    View Source

    NotifyForgotPasswordRequested(IPrincipal, string)

    Declaration
    public void NotifyForgotPasswordRequested(IPrincipal currentUser, string userId)
    Parameters
    Type Name Description
    IPrincipal currentUser
    string userId
    View Source

    NotifyLoginFailed(IPrincipal?, string)

    Declaration
    public void NotifyLoginFailed(IPrincipal? currentUser, string userId)
    Parameters
    Type Name Description
    IPrincipal currentUser
    string userId
    View Source

    NotifyLoginRequiresVerification(IPrincipal, string?)

    Declaration
    public void NotifyLoginRequiresVerification(IPrincipal currentUser, string? userId)
    Parameters
    Type Name Description
    IPrincipal currentUser
    string userId
    View Source

    NotifyLoginSuccess(IPrincipal, string)

    Declaration
    public void NotifyLoginSuccess(IPrincipal currentUser, string userId)
    Parameters
    Type Name Description
    IPrincipal currentUser
    string userId
    View Source

    NotifyLogoutSuccess(IPrincipal, string?)

    Declaration
    public SignOutSuccessResult NotifyLogoutSuccess(IPrincipal currentUser, string? userId)
    Parameters
    Type Name Description
    IPrincipal currentUser
    string userId
    Returns
    Type Description
    SignOutSuccessResult
    View Source

    NotifyPasswordChanged(IPrincipal?, string)

    Declaration
    public void NotifyPasswordChanged(IPrincipal? currentUser, string userId)
    Parameters
    Type Name Description
    IPrincipal currentUser
    string userId
    View Source

    NotifyPasswordReset(IPrincipal?, string)

    Declaration
    public void NotifyPasswordReset(IPrincipal? currentUser, string userId)
    Parameters
    Type Name Description
    IPrincipal currentUser
    string userId
    View Source

    NotifyResetAccessFailedCount(IPrincipal?, string)

    Declaration
    public void NotifyResetAccessFailedCount(IPrincipal? currentUser, string userId)
    Parameters
    Type Name Description
    IPrincipal currentUser
    string userId
    View Source

    ResetAccessFailedCountAsync(BackOfficeIdentityUser)

    Resets the access failed count for the specified user.

    Declaration
    public override Task<IdentityResult> ResetAccessFailedCountAsync(BackOfficeIdentityUser user)
    Parameters
    Type Name Description
    BackOfficeIdentityUser user

    The user whose failed access count should be reset.

    Returns
    Type Description
    Task<IdentityResult>

    The System.Threading.Tasks.Task that represents the asynchronous operation, containing the Microsoft.AspNetCore.Identity.IdentityResult of the operation.

    View Source

    SetLockoutEndDateAsync(BackOfficeIdentityUser, DateTimeOffset?)

    Locks out a user until the specified end date has passed. Setting a end date in the past immediately unlocks a user.

    Declaration
    public override Task<IdentityResult> SetLockoutEndDateAsync(BackOfficeIdentityUser user, DateTimeOffset? lockoutEnd)
    Parameters
    Type Name Description
    BackOfficeIdentityUser user

    The user whose lockout date should be set.

    DateTimeOffset? lockoutEnd

    The System.DateTimeOffset after which the user's lockout should end.

    Returns
    Type Description
    Task<IdentityResult>

    The System.Threading.Tasks.Task that represents the asynchronous operation, containing the Microsoft.AspNetCore.Identity.IdentityResult of the operation.

    View Source

    UnlockUser(IUser)

    Declaration
    public Task<Attempt<UserUnlockResult, UserOperationStatus>> UnlockUser(IUser user)
    Parameters
    Type Name Description
    IUser user
    Returns
    Type Description
    Task<Attempt<UserUnlockResult, UserOperationStatus>>
    View Source

    VerifyPasswordAsync(IUserPasswordStore<BackOfficeIdentityUser>, BackOfficeIdentityUser, string)

    Override to allow checking the password via the IBackOfficeUserPasswordChecker if one is configured

    Declaration
    protected override Task<PasswordVerificationResult> VerifyPasswordAsync(IUserPasswordStore<BackOfficeIdentityUser> store, BackOfficeIdentityUser user, string password)
    Parameters
    Type Name Description
    IUserPasswordStore<BackOfficeIdentityUser> store
    BackOfficeIdentityUser user
    string password
    Returns
    Type Description
    Task<PasswordVerificationResult>
    • Edit this page
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX