Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/279.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 具有自定义密码哈希器的asp.net标识_C#_Asp.net_Asp.net Identity_Identity - Fatal编程技术网

C# 具有自定义密码哈希器的asp.net标识

C# 具有自定义密码哈希器的asp.net标识,c#,asp.net,asp.net-identity,identity,C#,Asp.net,Asp.net Identity,Identity,所以我试图让asp.net与自定义密码哈希器一起工作。 当我用以下代码更改哈希器时,注册就起作用了 IPasswordHasher hasher = new CustomPassword(); UserManager.PasswordHasher = hasher; 但是,当在acountcontroller中使用以下代码作为登录方法时,登录方法一直说我的凭据不存在 IPasswordHasher hasher = new CustomPassword(); SignInManager.U

所以我试图让asp.net与自定义密码哈希器一起工作。 当我用以下代码更改哈希器时,注册就起作用了

IPasswordHasher hasher = new CustomPassword();

UserManager.PasswordHasher = hasher;
但是,当在acountcontroller中使用以下代码作为登录方法时,登录方法一直说我的凭据不存在

IPasswordHasher hasher = new CustomPassword();

SignInManager.UserManager.PasswordHasher = hasher;

我遗漏了什么吗?

出于好奇,为什么您要使用自己的密码哈希器而不是内置的?内置密码哈希器完成了它需要完成的任务。。你为什么要发明这么好用的东西?我必须从另一个应用程序登录,所以使用默认的哈希程序会很困难。你解决了这个问题吗?@Izzy有时你需要匹配旧系统的密码哈希算法,以便无缝地过渡到新系统。。。