Github使用2因子认证创建令牌 [英] Github create token with 2 factor authentication

查看:296
本文介绍了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-authentication
http://developer.github.com/v3/oauth/#createa-a-新授权

推荐答案

这实际上是有效的。我在短信代码过期时出现问题。

This actually works. I was having problems with the SMS codes expiring.

这篇关于Github使用2因子认证创建令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆