生成临时URL以重置密码 [英] Generate temporary URL to reset password
问题描述
我希望在我的网站上实现忘记密码"功能.我喜欢这样的选项:将包含临时的一次性使用URL的电子邮件在一段时间后过期的电子邮件发送给用户.
I am looking to implement a Forgot Password feature on my website. I like the option where an email containing a temporary one-time use URL that expires after some time is sent to the user.
我查看了以下页面以了解这些想法,但是我不确定如何使用ASP.NET和C#来实现.正如其中一位用户指出的那样,如果我可以在不将这些信息存储在数据库中的情况下实现它,那将是理想的选择.请告知.
I have looked at the following pages to get these ideas but I am not sure how to implement this using ASP.NET and C#. As one of the users indicated, if I can implement this without storing this information inside the database, that will be ideal. Please advise.
谢谢.
推荐答案
根据您的需要,您可以使用类似于以下格式的格式来加密信息
Depending on your needs, you could encrypt information, in a format similar to the following format
(UserId)-(ExpireDate)
加密数据,建立链接,然后解密数据并从那里开始采取行动...
Encrypt the data, make that the link, then decrypt the data and take action from there...
粗略,但很可能可用,并且不需要使用数据库
Crude, but most likely usable, and not requiring DB usage
这篇关于生成临时URL以重置密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!