Class MemberPasswordHasher
A password hasher for members
Namespace: Umbraco.Cms.Core.Security
Assembly: Umbraco.Infrastructure.dll
Syntax
public class MemberPasswordHasher : UmbracoPasswordHasher<MemberIdentityUser>
Remarks
This will check for the ASP.NET Identity password hash flag before falling back to the legacy password hashing format ("HMACSHA256")
Constructors
View SourceMemberPasswordHasher(LegacyPasswordSecurity, IJsonSerializer, IOptions<LegacyPasswordMigrationSettings>, ILogger<MemberPasswordHasher>)
Initializes a new instance of the MemberPasswordHasher class.
Declaration
public MemberPasswordHasher(LegacyPasswordSecurity legacyPasswordHasher, IJsonSerializer jsonSerializer, IOptions<LegacyPasswordMigrationSettings> legacyMachineKeySettings, ILogger<MemberPasswordHasher> logger)
Parameters
| Type | Name | Description |
|---|---|---|
| LegacyPasswordSecurity | legacyPasswordHasher | Provides legacy password hashing and verification functionality. |
| IJsonSerializer | jsonSerializer | Used to serialize and deserialize JSON data for password migration. |
| IOptions<LegacyPasswordMigrationSettings> | legacyMachineKeySettings | The configuration options for legacy machine key password migration. |
| ILogger<MemberPasswordHasher> | logger | The logger used for logging password hasher operations and events. |
Methods
View SourceVerifyHashedPassword(MemberIdentityUser, string, string)
Verifies a user's hashed password
Declaration
public override PasswordVerificationResult VerifyHashedPassword(MemberIdentityUser user, string hashedPassword, string providedPassword)
Parameters
| Type | Name | Description |
|---|---|---|
| MemberIdentityUser | user | The member whose password is being verified. |
| string | hashedPassword | The stored hashed password. |
| string | providedPassword | The plain-text password to verify. |
Returns
| Type | Description |
|---|---|
| PasswordVerificationResult | The verification result indicating whether the password matches. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown when the correct hashing algorith cannot be determined |