【问题标题】:Why do Google Authenticator and Duo produce different authentication codes?为什么 Google Authenticator 和 Duo 会产生不同的验证码?
【发布时间】:2019-03-05 14:23:47
【问题描述】:

我正在使用以下库来实现双因素身份验证:

https://github.com/speakeasyjs/speakeasy

该库生成以下二维码:

当我在 Google Authenticator 和 Duo 中扫描代码时,两个应用都会生成不同的令牌。

speakeasy 库仅将 Google Authenticator 令牌识别为有效。

为什么同一个二维码在两个不同的应用中会产生不同的令牌?

【问题讨论】:

    标签: node.js authentication two-factor-authentication google-duo


    【解决方案1】:

    我没有研究 Speakeasy 及其工作原理,但查看 QR 码和它编码的 URL 说明了几件事。 URL中的算法说它是SHA256,但是我相信Google Authenticator only supports SHA1是算法。因此,URL 可能在说一件事,而应用程序正在做另一件事。

    奇怪的是 Authenticator 正在工作,而 Duo 却没有,而我认为这种情况正好相反。

    此外,Google Authenticator 期望密钥以 base32 编码。我没用过 Duo,但也许这也造成了困难。

    抱歉,这不是一个很好的答案,但它可能会给你一些测试正在发生的事情的方向。

    【讨论】:

      猜你喜欢
      • 2023-03-18
      • 2022-01-24
      • 2016-11-13
      • 2017-02-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多