authentication - Google Authenticator - 缺少 otpauth 协议(protocol)参数

标签 authentication oauth google-oauth google-authenticator

我正在尝试为我的站点的 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:

enter image description here

那么我在那里缺少什么参数?

最佳答案

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/

相关文章:

javascript - 登录后查看 HTML 内容

youtube-api - Google API V3 OAUTH2 挂起 - 未创建 TokenResponse 用户凭据文件

google-cloud-platform - GCP 中的 oauth 配置是否有任何 terraform 资源(或 CLI 命令),也可以在 GCP 中添加授权域

python - 在 Mac OS X 中使用 Python 自动授权 Google Drive

java - RESTful API 客户端如何保存 oAuth token 以供将来的请求使用?

php - Symfony2 已登录但未在探查器中进行身份验证

Delphi OAuth 身份验证

php - Twitter oAuth 请求 token 无效

security - 如何通过 websockets 保护 MQTT

java - 具有现有 Oauth token 的 Spring Security Oauth