github-education-resources / teachers_pet

Command line tool to help teachers use GitHub in their classrooms
https://education.github.com/guide
MIT License
187 stars 74 forks source link

Support token creation (and 2FA) from the command line #28

Open afeld opened 10 years ago

afeld commented 10 years ago

This should be possible, but will take a bit of tinkering with to figure out. Might also be nice to pull out into a dedicated gem/script that can be shared between non-browser tools.

Would love input from people that are smarter than me :bowtie:

/cc @mislav

mislav commented 10 years ago

The code you linked in hub is a good reference implementation. The process of obtaining the token is straightforward with the exception the dummy POST for 2FA that has a purpose of sending off an SMS, which a GET /authorizations won't do (there was some discussion whether this is an API bug).