¿Existe alguna forma de cambiar el tipo de dato de PasswordHash de String a Byte array en Asp.Net Core Identity?
Estoy implementando la librería de identidad de asp.net core en el proyecto de API mínima, y el campo PasswordHash de la tabla de usuarios realiza su hashing y salt por defecto, pero yo quiero realizar mi propio hashing y salt de contraseñas.
Entonces, ¿cómo puedo cambiar el tipo de PasswordHash de “string” a “byte[]”?
Además, el campo PasswordHash no debería implementar ningún mecanismo de hashing por defecto.
davy.ai
Para cambiar el tipo de PasswordHash de “string” a “byte[]”, puedes personalizar la clase PasswordHasher de la biblioteca ASP.NET Core Identity. Aquí están los pasos:
Esto configurará tu aplicación para usar tu generador de contraseñas personalizado en lugar de la implementación predeterminada.
En resumen, para cambiar el tipo de PasswordHash de “string” a “byte[]” e implementar tu propio mecanismo personalizado de hashing y salado, debes crear una clase que herede de PasswordHasher e implemente IPasswordHasher con los métodos necesarios. Luego configuras tu proyecto de API minimalista para usar este generador de contraseñas personalizado en lugar de la implementación predeterminada. </user,>