View Source
Class BackOfficeUserManager<T>
Generic Back office user manager
Inheritance
System.Object
Assembly: Umbraco.Web.dll
Syntax
public class BackOfficeUserManager<T> : UserManager<T, int> where T : BackOfficeIdentityUser
Type Parameters
Constructors
View Source
BackOfficeUserManager(IUserStore<T, Int32>)
Declaration
public BackOfficeUserManager(IUserStore<T, int> store)
Parameters
Type |
Name |
Description |
IUserStore<T, System.Int32> |
store |
|
Properties
View Source
BackOfficeUserPasswordChecker
Gets/sets the default back office user password checker
Declaration
public IBackOfficeUserPasswordChecker BackOfficeUserPasswordChecker { get; set; }
Property Value
View Source
SupportsQueryableUsers
Declaration
public override bool SupportsQueryableUsers { get; }
Property Value
Type |
Description |
System.Boolean |
|
View Source
SupportsUserClaim
Declaration
public override bool SupportsUserClaim { get; }
Property Value
Type |
Description |
System.Boolean |
|
View Source
SupportsUserPhoneNumber
Declaration
public override bool SupportsUserPhoneNumber { get; }
Property Value
Type |
Description |
System.Boolean |
|
View Source
SupportsUserTwoFactor
Developers will need to override this to support custom 2 factor auth
Declaration
public override bool SupportsUserTwoFactor { get; }
Property Value
Type |
Description |
System.Boolean |
|
Methods
View Source
AccessFailedAsync(Int32)
Declaration
public override async Task<IdentityResult> AccessFailedAsync(int userId)
Parameters
Type |
Name |
Description |
System.Int32 |
userId |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<IdentityResult> |
|
View Source
ChangePasswordAsync(Int32, String, String)
Declaration
public override Task<IdentityResult> ChangePasswordAsync(int userId, string currentPassword, string newPassword)
Parameters
Type |
Name |
Description |
System.Int32 |
userId |
|
System.String |
currentPassword |
|
System.String |
newPassword |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<IdentityResult> |
|
View Source
ChangePasswordWithResetAsync(Int32, 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 Task<IdentityResult> ChangePasswordWithResetAsync(int userId, string token, string newPassword)
Parameters
Type |
Name |
Description |
System.Int32 |
userId |
|
System.String |
token |
|
System.String |
newPassword |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<IdentityResult> |
|
View Source
CheckPasswordAsync(T, String)
Logic used to validate a username and password
Declaration
public override async Task<bool> CheckPasswordAsync(T user, string password)
Parameters
Type |
Name |
Description |
T |
user |
|
System.String |
password |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Boolean> |
|
View Source
GeneratePassword()
Helper method to generate a password for a user based on the current password validator
Declaration
public string GeneratePassword()
Returns
Type |
Description |
System.String |
|
View Source
GenerateUserIdentityAsync(T)
Declaration
public virtual async Task<ClaimsIdentity> GenerateUserIdentityAsync(T user)
Parameters
Type |
Name |
Description |
T |
user |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Security.Claims.ClaimsIdentity> |
|
View Source
GetCurrentRequestIpAddress()
Returns the current request IP address for logging if there is one
Declaration
protected virtual string GetCurrentRequestIpAddress()
Returns
Type |
Description |
System.String |
|
View Source
GetDefaultPasswordHasher(MembershipProviderBase)
This will determine which password hasher to use based on what is defined in config
Declaration
protected virtual IPasswordHasher GetDefaultPasswordHasher(MembershipProviderBase provider)
Parameters
Returns
Type |
Description |
IPasswordHasher |
|
View Source
InitUserManager(BackOfficeUserManager<T>, MembershipProviderBase, IDataProtectionProvider, IContentSection)
Initializes the user manager with the correct options
Declaration
protected void InitUserManager(BackOfficeUserManager<T> manager, MembershipProviderBase membershipProvider, IDataProtectionProvider dataProtectionProvider, IContentSection contentSectionConfig)
Parameters
View Source
IsLockedOutAsync(Int32)
Override to check the user approval value as well as the user lock out date, by default this only checks the user's locked out date
Declaration
public override async Task<bool> IsLockedOutAsync(int userId)
Parameters
Type |
Name |
Description |
System.Int32 |
userId |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Boolean> |
|
View Source
OnAccountLocked(IdentityAuditEventArgs)
Declaration
protected virtual void OnAccountLocked(IdentityAuditEventArgs e)
Parameters
View Source
OnAccountUnlocked(IdentityAuditEventArgs)
Declaration
protected virtual void OnAccountUnlocked(IdentityAuditEventArgs e)
Parameters
View Source
OnForgotPasswordChangedSuccess(IdentityAuditEventArgs)
Declaration
protected virtual void OnForgotPasswordChangedSuccess(IdentityAuditEventArgs e)
Parameters
View Source
OnForgotPasswordRequested(IdentityAuditEventArgs)
Declaration
protected virtual void OnForgotPasswordRequested(IdentityAuditEventArgs e)
Parameters
View Source
OnLoginFailed(IdentityAuditEventArgs)
Declaration
protected virtual void OnLoginFailed(IdentityAuditEventArgs e)
Parameters
View Source
OnLoginRequiresVerification(IdentityAuditEventArgs)
Declaration
protected virtual void OnLoginRequiresVerification(IdentityAuditEventArgs e)
Parameters
View Source
OnLoginSuccess(IdentityAuditEventArgs)
Declaration
protected virtual void OnLoginSuccess(IdentityAuditEventArgs e)
Parameters
View Source
OnLogoutSuccess(IdentityAuditEventArgs)
Declaration
protected virtual void OnLogoutSuccess(IdentityAuditEventArgs e)
Parameters
View Source
OnPasswordChanged(IdentityAuditEventArgs)
Declaration
protected virtual void OnPasswordChanged(IdentityAuditEventArgs e)
Parameters
View Source
OnPasswordReset(IdentityAuditEventArgs)
Declaration
protected virtual void OnPasswordReset(IdentityAuditEventArgs e)
Parameters
View Source
OnResetAccessFailedCount(IdentityAuditEventArgs)
Declaration
protected virtual void OnResetAccessFailedCount(IdentityAuditEventArgs e)
Parameters
View Source
OnSendingUserInvite(UserInviteEventArgs)
Declaration
protected virtual void OnSendingUserInvite(UserInviteEventArgs e)
Parameters
View Source
ResetAccessFailedCountAsync(Int32)
Declaration
public override async Task<IdentityResult> ResetAccessFailedCountAsync(int userId)
Parameters
Type |
Name |
Description |
System.Int32 |
userId |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<IdentityResult> |
|
View Source
ResetPasswordAsync(Int32, String, String)
Declaration
public override Task<IdentityResult> ResetPasswordAsync(int userId, string token, string newPassword)
Parameters
Type |
Name |
Description |
System.Int32 |
userId |
|
System.String |
token |
|
System.String |
newPassword |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<IdentityResult> |
|
View Source
SetLockoutEndDateAsync(Int32, DateTimeOffset)
Declaration
public override async Task<IdentityResult> SetLockoutEndDateAsync(int userId, DateTimeOffset lockoutEnd)
Parameters
Type |
Name |
Description |
System.Int32 |
userId |
|
System.DateTimeOffset |
lockoutEnd |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<IdentityResult> |
|
View Source
UpdatePassword(IUserPasswordStore<T, Int32>, T, String)
Override to determine how to hash the password
Declaration
protected override async Task<IdentityResult> UpdatePassword(IUserPasswordStore<T, int> passwordStore, T user, string newPassword)
Parameters
Type |
Name |
Description |
IUserPasswordStore<T, System.Int32> |
passwordStore |
|
T |
user |
|
System.String |
newPassword |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<IdentityResult> |
|
View Source
ValidateSessionIdAsync(Int32, String)
Used to validate a user's session
Declaration
public virtual async Task<bool> ValidateSessionIdAsync(int userId, string sessionId)
Parameters
Type |
Name |
Description |
System.Int32 |
userId |
|
System.String |
sessionId |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Boolean> |
|
View Source
VerifyPasswordAsync(IUserPasswordStore<T, Int32>, T, String)
Override to determine how to hash the password
Declaration
protected override async Task<bool> VerifyPasswordAsync(IUserPasswordStore<T, int> store, T user, string password)
Parameters
Type |
Name |
Description |
IUserPasswordStore<T, System.Int32> |
store |
|
T |
user |
|
System.String |
password |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Boolean> |
|
Events
View Source
AccountLocked
Declaration
public static event EventHandler AccountLocked
Event Type
Type |
Description |
System.EventHandler |
|
View Source
AccountUnlocked
Declaration
public static event EventHandler AccountUnlocked
Event Type
Type |
Description |
System.EventHandler |
|
View Source
ForgotPasswordChangedSuccess
Declaration
public static event EventHandler ForgotPasswordChangedSuccess
Event Type
Type |
Description |
System.EventHandler |
|
View Source
ForgotPasswordRequested
Declaration
public static event EventHandler ForgotPasswordRequested
Event Type
Type |
Description |
System.EventHandler |
|
View Source
LoginFailed
Declaration
public static event EventHandler LoginFailed
Event Type
Type |
Description |
System.EventHandler |
|
View Source
LoginRequiresVerification
Declaration
public static event EventHandler LoginRequiresVerification
Event Type
Type |
Description |
System.EventHandler |
|
View Source
LoginSuccess
Declaration
public static event EventHandler LoginSuccess
Event Type
Type |
Description |
System.EventHandler |
|
View Source
LogoutSuccess
Declaration
public static event EventHandler LogoutSuccess
Event Type
Type |
Description |
System.EventHandler |
|
View Source
PasswordChanged
Declaration
public static event EventHandler PasswordChanged
Event Type
Type |
Description |
System.EventHandler |
|
View Source
PasswordReset
Declaration
public static event EventHandler PasswordReset
Event Type
Type |
Description |
System.EventHandler |
|
View Source
ResetAccessFailedCount
Declaration
public static event EventHandler ResetAccessFailedCount
Event Type
Type |
Description |
System.EventHandler |
|
View Source
SendingUserInvite
Raised when a user is invited
Declaration
public static event EventHandler SendingUserInvite
Event Type
Type |
Description |
System.EventHandler |
|