Github 创建具有 2 因素身份验证的令牌 [英] Github create token with 2 factor authentication
本文介绍了Github 创建具有 2 因素身份验证的令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试授权用户并取回令牌.用户启用了 2 因素身份验证.
I am trying to get a authorize a user and get a token back. The user has 2 factor authentication on.
这是我要使用的代码.它不会接受我通过短信获得的代码.如果用户没有启用 2fa,这会起作用.
This is the code I am tring to use. It will not accept the code I get via SMS. This works if the user does not have 2fa enabled.
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-authenticationhttp://developer.github.com/v3/oauth/#create-a-新授权
推荐答案
这确实有效.我遇到了短信验证码过期问题.
This actually works. I was having problems with the SMS codes expiring.
这篇关于Github 创建具有 2 因素身份验证的令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文