什么是与现时电子邮件激活/注册/密码重置链接的最佳实践 [英] What are best practices for activation/registration/password-reset links in emails with nonce

查看:140
本文介绍了什么是与现时电子邮件激活/注册/密码重置链接的最佳实践的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

应用程序发送电子邮件,以验证用户帐户或重置密码。我相信下面是事情应该是这样,我要求引用和实现。

Applications send out emails to verify user accounts or reset a password. I believe the following is the way it should be and I am asking for references and implementations.

如果一个应用程序发送一个链接的电子邮件,以验证用户的地址,按照我的观点,该链接的链接和应用程序的处理应具有以下特点:

If an application has to send out a link in an email to verify the user's address, according to my view, the link and the application's processing of the link should have the following characteristics:


  1. 的链接包含现时在请求URI(的http://主机/路径?现时)。

  2. 在以下的链接(GET)中,用户是presented形式,任选地与随机数。

  3. 用户确认输入(POST)。

  4. 服务器接收请求,

    • 检查输入参数,

    • 执行的变化,

    • 和无效的随机数。

  1. The link contains a nonce in the request URI (http://host/path?nonce).
  2. On following the link (GET), the user is presented a form, optionally with the nonce.
  3. User confirms the input (POST).
  4. The server receives the request and
    • checks input parameters,
    • performs the change,
    • and invalidates the nonce.

这应该是每对安全和幂等方法 HTTP RFC正确的。

This should be correct per HTTP RFC on Safe and Idempotent Methods.

的问题是,该方法涉及一个附加的页面或用户动作(第3项),这是由许多人认为是多余的(如果不是无用)。我有问题presenting这种方法同行和客户,所以我从更广泛的技术小组,要求输入这一点。我反对跳过后工序的唯一论据是从浏览器链接的可能pre加载。

The problem is that this process involves one additional page or user action (item 3), which is considered superfluous (if not useless) by a lot of people. I had problems presenting this approach to peers and customers, so I am asking for input on this from a broader technical group. The only argument I had against skipping the POST step was a possible pre-loading of the link from the browser.

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆