I want to move from ASP.NET MVC Identity to node.js. I have the following field in my database:
PasswordHash: AOCB5TrZGusq9ZUdYd/w/u7GUZTPOMG7JhFd4JgS0gLOulL8QjZRbl4T6sPXwD3lfQ==
The password is asdfgak. I have no idea how to use this PasswordHash and how to get the hash and salt from it to login users from node.js.
I saw this answer but it didn't help at all, the output from this was the following:
A+w9Dyfupc+dMkViA0eYF4ol7HhdIfVPct6o47a+n5M=
Here is the code that I have in my MVC project, if that helps:
public class ApplicationUser : IdentityUser
{
public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager)
{
var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
// Add custom user claims here
return userIdentity;
}
// my custom fields like username, gender...
}
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
public ApplicationDbContext()
: base("Personal", throwIfV1Schema: false)
{
}
public static ApplicationDbContext Create()
{
return new ApplicationDbContext();
}
}