0
oshabani created
If you're creating a bug/problem report, please include followings:
- ABP Framework version: v5.2
- UI type: / MVC
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): no
- Exception message and stack trace:
- Steps to reproduce the issue:"
Salam ,
I need to have users password as a Palin Text , when the user register or update their passwords i want to save the passwords as Plain Text so when i want to migrate all users to different Identity Providers
thanks
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
5 Answer(s)
-
0
hi
You can custom the
IPasswordHasherservice. this belongs ASP NET Core Identitiy,https://github.com/dotnet/aspnetcore/blob/main/src/Identity/Extensions.Core/src/IPasswordHasher.cs
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
string HashPassword(TUser user, string password);Override this method just return the
passwordThe Identity will use this interface to hash and verify passwords.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
public override void ConfigureServices(ServiceConfigurationContext context) { context.Services.Replace(ServiceDescriptor.Scoped<IPasswordHasher<IdentityUser>, MyPasswordHasher>()); }using Microsoft.AspNetCore.Identity; using IdentityUser = Volo.Abp.Identity.IdentityUser; namespace MyCompanyName.MyProjectName; public class MyPasswordHasher : IPasswordHasher<IdentityUser> { public string HashPassword(IdentityUser user, string password) { return password; } public PasswordVerificationResult VerifyHashedPassword(IdentityUser user, string hashedPassword, string providedPassword) { return hashedPassword == providedPassword ? PasswordVerificationResult.Success : PasswordVerificationResult.Failed; } }Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)