通过电子邮件链接验证用户帐户
真的很抱歉,因为这几乎是“请向我发送代码” - 尽管实际上是“请向我发送另一个讨论的链接”,
我正在建立一个 .net 会员系统,需要通过他们提供的电子邮件地址来验证用户“单击此处验证您的帐户”类型链接。
只是想知道是否有人知道关于此的任何好的教程或帖子?我搜索了大约一个小时,但找不到任何东西 - 因此我问这个问题。
提前致谢。 抢
Really sorry because this is almost "please send me the code" - although really it's "please send me a link to another discussion"
I am setting up a .net membership system and need to validate users from the email address they provide via a "click here to validate your account" type link.
Just wondered if anyone knew of any good tutorials or posts out there about this? I have searched for about an hour and can't find anything - hence me asking the question.
Thanks in advance.
Rob
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这非常简单,一旦他们提交申请表,记录一个“令牌”变量,发送您的电子邮件,将令牌变量添加到网址,在数据库中搜索令牌,验证用户......!简单的。
This is very easy, once they submit their application form, log a "token" variable, dispatch your email, add the token variable to the url, search for the token in the db, validate user...!! Simple.
当他们注册时,向他们发送一些带有固定盐的数据的哈希值。诸如注册时间和用户 ID 之类的信息。当他们单击指向 /verify?q=ahash 之类的电子邮件链接时,只需检查哈希值涉及哪些用户数据,然后更新数据库以反映他们是有效用户。
When they are registering send them a hash of some of their data with a fixed salt. Stuff like time of registration and user-id. When they click the email link to something like /verify?q=ahash, just check to see which users data the hash amounts to, and update the database to reflect that they are a valid user.