本文介绍了在Identity 2.1中编写自定义IUserPasswordStore和SignInManager.PasswordSignInAsync的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

构建自定义IUserPasswordStore以连接到旧版系统的用户名/密码表.密码在表中用自定义代码散列,因此我需要为PasswordSignInAsync编写自定义代码.

Building a custom IUserPasswordStore to connect to a legacy system's username/password table. The password is hashed with custom code in the table so I need to write custom code for PasswordSignInAsync.

我是否需要覆盖PasswordSignInAsync还是可以提供一种仅对密码进行哈希处理的方法?如果我确实覆盖了整个PasswordSignInAsync,是否有示例代码在某处显示出该方法需要做什么?

Do I need to override PasswordSignInAsync or is there a method I can provide that just does the hashing of the password? If I do override the entire PasswordSignInAsync is there sample code somewhere showing me what needs to be done in the method?

推荐答案

那比我想象的要容易.

覆盖UserManager中的CheckPasswordAsync.

这篇关于在Identity 2.1中编写自定义IUserPasswordStore和SignInManager.PasswordSignInAsync的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 04:38