qr-code - 如何为 Google Authenticator 生成正确显示在 OTP 上方显示的 Issuer 的 QR 码?

标签 qr-code google-authenticator

Warning: sharing your TOTP seed with third-parties breaks the very basic assumption of multi-factor authentication that the TOTP seed is secret.



所以,我知道这方面的文档,在这里找到:Google Authenticator Key URI Format

当我从该页面遵循此示例时:
otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example

我将它“拼接”到 Google Charts URL 中,因此:
https://www.google.com/chart?chs=200x200&chld=M|0&cht=qr&chl=otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example

它将显示一个有效的 QR 码,如果我用手机上的 Google Authenticator 应用程序扫描它,它将开始生成有效的 OTP。

但是,在手机上的显示中,对于由 QR 码创建的条目,我得到了 OTP,在它下面,我得到了“Example:alice@google.com”。我想要的是在 OTP 上方显示“示例”,在 OTP 下方显示“alice@google.com”。我不禁注意到所有专业制作的应用程序都是这样做的。例如,Google、Wordpress、Amazon 等。公司名称在 OTP 上方,用户名显示在 OTP 下方。是的,这纯粹是一个表面问题,但我想把它做好。

谁能给我一个线索?

最佳答案

从信息安全的角度来看,推荐使用 Google Charts 的响应绝对是糟糕的。这实质上是与第三方公司共享 TOTP secret 以及您的用户名 (alice@google.com) 和发行人 (Example),而没有法律义务对其保密,并通过 GET 进行此操作。要求!这样做不仅违反了多因素身份验证的每一个假设,而且很可能违反了您组织的信息安全政策。它使 MFA 增加的任何值(value)无效,因为在密码泄露的情况下保护您的帐户免遭破坏的唯一因素本身就被破坏了。
只需使用任何 QR 码生成器,只要它在本地处理您的数据即可。
切勿将在线 QR 生成器用于 MFA secret
在 Linux 上,我推荐 python-qrcode可以在控制台上使用 UTF-8 字符打印 QR 码的库。

pip install qrcode
然后:
qr "otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example"
enter image description here

关于qr-code - 如何为 Google Authenticator 生成正确显示在 OTP 上方显示的 Issuer 的 QR 码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34520928/

相关文章:

java - 如何在 Android 上使用 zxing 对 QR 码中的字符串进行编码?

javascript - angular-qrcode Angular如何使用?

asp.net-core-mvc - 带有 ASP.NET Core 的谷歌身份验证器

ios - 扫描成功后如何关闭二维码扫描器 - Swift 4

java - QRGen库导入无法解决

ios - 如何在 Swift 中检测图像中的条形码?

django - Google Authenticator (Android) + Django 即使在时间同步之后也说无效 token

linux - 无法连接 openvpn ubuntu 16.04

python - Google oAuth 2.0 API 身份验证错误 : Error 400 - redirect_uri_mismatch (does not comply with policy) DJANGO APP

google-plus - Android Google Auth 登录获取 ID token handleSignInResult :false