我想要授权用户并获得一个令牌。该用户启用了双重身份验证,我正在尝试使用以下代码。当我通过短信收到的代码时它无法接受。如果用户未启用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