Class BackOfficeUserManager<T>
Generic Back office user manager
Inheritance
System.Object
Microsoft.AspNet.Identity.UserManager<T, System.Int32>
Namespace:System.Dynamic.ExpandoObject
Assembly:Umbraco.Core.dll
Syntax
public class BackOfficeUserManager<T> : UserManager<T, int>, IDisposable where T : BackOfficeIdentityUser
Type Parameters
Constructors
BackOfficeUserManager(IUserStore<T, Int32>)
Declaration
public BackOfficeUserManager(IUserStore<T, int> store)
Parameters
Type |
Name |
Description |
Microsoft.AspNet.Identity.IUserStore<T, System.Int32> |
store |
|
Properties
BackOfficeUserPasswordChecker
Gets/sets the default back office user password checker
Declaration
public IBackOfficeUserPasswordChecker BackOfficeUserPasswordChecker { get; set; }
Property Value
SupportsQueryableUsers
Declaration
public override bool SupportsQueryableUsers { get; }
Property Value
Type |
Description |
System.Boolean |
|
SupportsUserClaim
Declaration
public override bool SupportsUserClaim { get; }
Property Value
Type |
Description |
System.Boolean |
|
SupportsUserPhoneNumber
Declaration
public override bool SupportsUserPhoneNumber { get; }
Property Value
Type |
Description |
System.Boolean |
|
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
AccessFailedAsync(Int32)
Declaration
public override Task<IdentityResult> AccessFailedAsync(int userId)
Parameters
Type |
Name |
Description |
System.Int32 |
userId |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<Microsoft.AspNet.Identity.IdentityResult> |
|
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<Microsoft.AspNet.Identity.IdentityResult> |
|
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<Microsoft.AspNet.Identity.IdentityResult> |
|
CheckPasswordAsync(T, String)
Logic used to validate a username and password
Declaration
public override 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> |
|
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 |
|
GetCurrentRequestIpAddress()
Returns the current request IP address for logging if there is one
Declaration
protected virtual string GetCurrentRequestIpAddress()
Returns
Type |
Description |
System.String |
|
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 |
Microsoft.AspNet.Identity.IPasswordHasher |
|
InitUserManager(BackOfficeUserManager<T>, MembershipProviderBase, IDataProtectionProvider)
Declaration
[Obsolete("Use the overload specifying all dependencies instead")]
protected void InitUserManager(BackOfficeUserManager<T> manager, MembershipProviderBase membershipProvider, IDataProtectionProvider dataProtectionProvider)
Parameters
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
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 Task<bool> IsLockedOutAsync(int userId)
Parameters
Type |
Name |
Description |
System.Int32 |
userId |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Boolean> |
|
OnAccountLocked(IdentityAuditEventArgs)
Declaration
protected virtual void OnAccountLocked(IdentityAuditEventArgs e)
Parameters
OnAccountUnlocked(IdentityAuditEventArgs)
Declaration
protected virtual void OnAccountUnlocked(IdentityAuditEventArgs e)
Parameters
OnForgotPasswordChangedSuccess(IdentityAuditEventArgs)
Declaration
protected virtual void OnForgotPasswordChangedSuccess(IdentityAuditEventArgs e)
Parameters
OnForgotPasswordRequested(IdentityAuditEventArgs)
Declaration
protected virtual void OnForgotPasswordRequested(IdentityAuditEventArgs e)
Parameters
OnLoginFailed(IdentityAuditEventArgs)
Declaration
protected virtual void OnLoginFailed(IdentityAuditEventArgs e)
Parameters
OnLoginRequiresVerification(IdentityAuditEventArgs)
Declaration
protected virtual void OnLoginRequiresVerification(IdentityAuditEventArgs e)
Parameters
OnLoginSuccess(IdentityAuditEventArgs)
Declaration
protected virtual void OnLoginSuccess(IdentityAuditEventArgs e)
Parameters
OnLogoutSuccess(IdentityAuditEventArgs)
Declaration
protected virtual void OnLogoutSuccess(IdentityAuditEventArgs e)
Parameters
OnPasswordChanged(IdentityAuditEventArgs)
Declaration
protected virtual void OnPasswordChanged(IdentityAuditEventArgs e)
Parameters
OnPasswordReset(IdentityAuditEventArgs)
Declaration
protected virtual void OnPasswordReset(IdentityAuditEventArgs e)
Parameters
OnResetAccessFailedCount(IdentityAuditEventArgs)
Declaration
protected virtual void OnResetAccessFailedCount(IdentityAuditEventArgs e)
Parameters
ResetAccessFailedCountAsync(Int32)
Declaration
public override Task<IdentityResult> ResetAccessFailedCountAsync(int userId)
Parameters
Type |
Name |
Description |
System.Int32 |
userId |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<Microsoft.AspNet.Identity.IdentityResult> |
|
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<Microsoft.AspNet.Identity.IdentityResult> |
|
SetLockoutEndDateAsync(Int32, DateTimeOffset)
Declaration
public override Task<IdentityResult> SetLockoutEndDateAsync(int userId, DateTimeOffset lockoutEnd)
Parameters
Type |
Name |
Description |
System.Int32 |
userId |
|
System.DateTimeOffset |
lockoutEnd |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<Microsoft.AspNet.Identity.IdentityResult> |
|
UpdatePassword(IUserPasswordStore<T, Int32>, T, String)
Override to determine how to hash the password
Declaration
protected override Task<IdentityResult> UpdatePassword(IUserPasswordStore<T, int> passwordStore, T user, string newPassword)
Parameters
Type |
Name |
Description |
Microsoft.AspNet.Identity.IUserPasswordStore<T, System.Int32> |
passwordStore |
|
T |
user |
|
System.String |
newPassword |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<Microsoft.AspNet.Identity.IdentityResult> |
|
ValidateSessionIdAsync(Int32, String)
Used to validate a user's session
Declaration
public virtual 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> |
|
VerifyPasswordAsync(IUserPasswordStore<T, Int32>, T, String)
Override to determine how to hash the password
Declaration
protected override Task<bool> VerifyPasswordAsync(IUserPasswordStore<T, int> store, T user, string password)
Parameters
Type |
Name |
Description |
Microsoft.AspNet.Identity.IUserPasswordStore<T, System.Int32> |
store |
|
T |
user |
|
System.String |
password |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Boolean> |
|
Events
AccountLocked
Declaration
public static event EventHandler AccountLocked
Event Type
Type |
Description |
System.EventHandler |
|
AccountUnlocked
Declaration
public static event EventHandler AccountUnlocked
Event Type
Type |
Description |
System.EventHandler |
|
ForgotPasswordChangedSuccess
Declaration
public static event EventHandler ForgotPasswordChangedSuccess
Event Type
Type |
Description |
System.EventHandler |
|
ForgotPasswordRequested
Declaration
public static event EventHandler ForgotPasswordRequested
Event Type
Type |
Description |
System.EventHandler |
|
LoginFailed
Declaration
public static event EventHandler LoginFailed
Event Type
Type |
Description |
System.EventHandler |
|
LoginRequiresVerification
Declaration
public static event EventHandler LoginRequiresVerification
Event Type
Type |
Description |
System.EventHandler |
|
LoginSuccess
Declaration
public static event EventHandler LoginSuccess
Event Type
Type |
Description |
System.EventHandler |
|
LogoutSuccess
Declaration
public static event EventHandler LogoutSuccess
Event Type
Type |
Description |
System.EventHandler |
|
PasswordChanged
Declaration
public static event EventHandler PasswordChanged
Event Type
Type |
Description |
System.EventHandler |
|
PasswordReset
Declaration
public static event EventHandler PasswordReset
Event Type
Type |
Description |
System.EventHandler |
|
ResetAccessFailedCount
Declaration
public static event EventHandler ResetAccessFailedCount
Event Type
Type |
Description |
System.EventHandler |
|