gpt4 book ai didi

asp.net-mvc - 如何处理 node.js 中的 ASP.NET 身份记录?

转载 作者:搜寻专家 更新时间:2023-10-31 23:54:00 24 4
gpt4 key购买 nike

我想从 ASP.NET MVC Identity 迁移到 node.js。我的数据库中有以下字段:

PasswordHash: AOCB5TrZGusq9ZUdYd/w/u7GUZTPOMG7JhFd4JgS0gLOulL8QjZRbl4T6sPXwD3lfQ==

密码是 asdfgak。我不知道如何使用此 PasswordHash 以及如何从中获取哈希和盐以从 node.js 登录用户。

我看到了this回答但它根本没有帮助,输出如下:

A+w9Dyfupc+dMkViA0eYF4ol7HhdIfVPct6o47a+n5M=

这是我的 MVC 项目中的代码,如果有帮助的话:

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();
}
}

最佳答案

好的,我发现了这个模块,你甚至可以在同步和异步之间进行选择,这太棒了:

https://www.npmjs.com/package/aspnet-identity-pw

关于asp.net-mvc - 如何处理 node.js 中的 ASP.NET 身份记录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30269487/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com