我需要在我们的 asp.net 网站上提供重置用户密码的功能。
为此,用户必须提供他们注册时使用的电子邮件地址,并且该功能应该重置他们忘记的密码,这很容易。
棘手的部分是考虑到站点的成员模型(不使用标准的 AspnetMembershipProviders)站点使用自己的处理用户的系统。
这个问题的支点是关于我已经被提供并且我必须遵循的要求,它们是:
1) User can enter email address to reset password
2) the password that is sent to the email address provided
3) the temporary password must be valid for no more than 24 hours
4) the email will provide the link to allow them to enter the temporary password
5) when they log in they must be prompted to reset to a permanent password
6) the temporary password must be single use
对于第 3 点,一位同事建议使用 SQL 作业来自动化时间限制,但我不完全确定这将如何工作,或者它是否是最佳方法。
对于第 6 点,我正在考虑使用触发器在用于登录时使临时密码无效,这样如果他们再次尝试,他们将不得不再次完成整个过程。
3 和 6 是我想了解的部分,在解释您的答案时,您能否尝试说明为什么应该使用规定的方法来完成,以便我可以更好地判断哪个答案最适合我的要求。