如何不使用 ASP.Net 会员安全问题和答案进行自定义密码恢复?
我不想拥有 ASP.Net 会员提供商提供的安全问题和答案功能,但我确实想启用丢失/忘记密码页面。
在此页面上,用户输入他/她的电子邮件地址,如果用户注册了,则通过发送到该注册电子邮件地址的链接重置密码,电子邮件将发送到该地址
我已创建自定义表格为了跟踪此类请求,分配给请求的随机密钥以及请求的到期日期。 然而,在编写实际重置密码的代码时,我意识到似乎没有一种方法可以执行类似 ResetPassword(email, newPassword) 的操作,而无需使用安全问答位(我没有)。
有没有什么方法可以通过内置的会员功能简单地重置用户密码?
如果没有,我需要如何完成这件事?
预先感谢您提供的任何帮助。 -日产
I don't want to have the security question and answer feature that ASP.Net Membership Provider gives, but I DO want to enable a lost/forgotten password page.
This page would be where a user would enter his/her email address and an email would be sent to that address if the user was registered for them to reset their password via a link sent to that registered email address
I've created the custom table to track such requests, the random key assigned to the request as well as an expiry date on the request. However in writing the code to actually reset the password, I realised that there doesn't seem to be a method that does something like ResetPassword(email, newPassword) without needing to use the Security Q&A bit (which I don't have).
Is there any way to simply reset a user's password via a built in Membership function?
If not, how would I need to get this done?
Thanks in advance for any help given.
-Nissan
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我最终做了以下事情,
然后我添加了一个新方法来使用该值来更改密码
What I ended up doing was the following
then I added a new method to use this value to change the password
为什么不在 web.config 中更改此选项?
在
Why don't you change this options in web.config?
in