Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub 2 factor login #292

Closed
scj643 opened this issue Aug 24, 2016 · 4 comments
Closed

GitHub 2 factor login #292

scj643 opened this issue Aug 24, 2016 · 4 comments

Comments

@scj643
Copy link

scj643 commented Aug 24, 2016

The api has no support for 2 factor authentication.

@Shredder121
Copy link
Contributor

An OAuth token would be the way to go.
https://developer.github.com/v3/auth/#working-with-two-factor-authentication

So either implement the X-GitHub-OTP flow, or use an OAuth token.
Keep in mind that GitHub also recommends an OAuth token

Because these authentication codes expire quickly, we recommend using the Authorizations API to create an access token and using that token to authenticate via OAuth for most API access.

@madhephaestus
Copy link
Contributor

Is there a workflow for application developers to use this?

Some code examples of programmatically converting a user/pass combo into an oauth token?

Specifically: I need a code example to get an OAuth token in the first place, given that in my code flow i have the username and password. I totally understand how to get a token out of pipeline, stick it in a hidden ~/.github text file, and can see it working. I have no idea how to use the Java code to get that token programmatically.

I have an application using Github-api and would be very interested in a tested working example of using 2fa with the provided Java API (or a new API). Adding suggestions to re-parse API calls that the library was designed to interface with leaves me very confused with where to start and how this suggestion fits with the already provided code examples.

@bitwiseman
Copy link
Member

This works as expected.

@madhephaestus
Copy link
Contributor

I can now confirm that the full 2 factor authentication workflow for requesting a token works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants