Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github create token with 2 factor authentication

I am trying to get a authorize a user and get a token back. The user has 2 factor authentication on.

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/#create-a-new-authorization

like image 564
Cameron White Avatar asked Jul 03 '26 04:07

Cameron White


1 Answers

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

like image 52
Cameron White Avatar answered Jul 06 '26 16:07

Cameron White



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!