我正在尝试获得用户授权并取回 token 。用户启用了 2 因素身份验证。
这是我尝试使用的代码。它不会接受我通过短信获得的代码。如果用户没有启用 2fa,这会起作用。
curl -i -u $user -H "X-GitHub-OTP: $code" \
-d '{"scopes": [ "repo" ], "note": "program"}' \
https://api.github.com/authorizations
http://developer.github.com/v3/auth/#working-with-two-factor-authentication http://developer.github.com/v3/oauth/#create-a-new-authorization
最佳答案
这确实有效。我遇到了 SMS 代码过期的问题。
关于api - Github 使用 2 因素身份验证创建 token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20065691/