一次随机数 http 摘要认证

One time nonce http digest authentication

我尝试为 HTTP 摘要身份验证过程实施一次性 none。首先,我知道身份验证并不完全安全。请不要告诉我使用其他东西。身份验证过程按预期工作。当用户身份验证成功时,我会在下一个随机数后附加一个 http Authentication-Info 字段。在这种情况下,浏览器 Firefox 不会将此随机数用于进一步的请求。

Authentication-Info: nextnonce="06e8043d3fb8c26156829c4b55afd13040"

为什么浏览器不在以后的请求中使用我的新随机数?它仍然使用旧的现在无效的!

RFC7616 描述了 header 字段。 https://www.rfc-editor.org/rfc/rfc7616#section-3.5

The value of the nextnonce parameter is the nonce the server wishes the client to use for a future authentication response. The server MAY send the Authentication-Info header field with a nextnonce field as a means of implementing one-time nonces or otherwise changing nonces. If the nextnonce field is present, ...

RFC2617 描述了第 3.2.3 节中的语法

https://www.ietf.org/rfc/rfc2617.txt

[编辑]

有没有可能是firefox不支持这个功能。如果我在这里搜索 https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/WWW-Authenticate 对于 header 字段,我找不到结果。

但它在此处被列为标准 header 标志: https://www.iana.org/assignments/message-headers/message-headers.xhtml

Firefox 不支持

nextnonce,甚至 Authentication-Info header.

bug "next nonce digest auth test fails" 18 年前就开过了,现在还没有修复。

我下载了最新的Firefox 65.0.1版本的source code并搜索了项目。 "Authentication-Info" 仅作为评论出现在 netwerk/protocol/http/nsHttpDigestAuth.cpp 中,没有出现在其他地方。