我正在尝试为我的站点的 Google Authenticator 应用程序生成 QR 码(用于双重身份验证用户登录。)我关注 this guideline生成 URI(使用 Google Chart API。)
所以我编了这个网址:
https://chart.googleapis.com/chart?chs=200x200&chld=M%7C0&cht=qr&chl=otpauth://totp/Example:alice@gmail.com?secret=TGABZXEP4LKB46AX&issuer=Example
创建了 QR 码(来自上面的链接。)
但是当我用 Google Authenticator app 扫描它时对于我的 iPhone,我得到的行不像其他服务那样显示发行人(在此屏幕截图中以红色圈出)——请参阅其他条目中的 Google:
那么我在那里缺少什么参数?
最佳答案
otpauth uri 必须在图表 url 中编码。https://chart.googleapis.com/chart?chs=200x200&chld=M|0&cht=qr&chl=otpauth%3A%2F%2Ftotp%2FExample%3Aalice%40gmail.com%3Fsecret%3DTGABZXEP4LKB46AX%26issuer%3DExample
您可以通过替换 ...&issuer=...
与 ...%26issuer=...
,但正确编码的 url 是最好的。
关于authentication - Google Authenticator - 缺少 otpauth 协议(protocol)参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28057161/