-
Notifications
You must be signed in to change notification settings - Fork 611
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
Cannot use an access token when 2fa is active #458
Comments
Hmm it sounds like you're using an OAuth token? Ultimately this will be something in the underlying github-api. See issue here. |
Hm, no basically i am using a normal access token... |
Gotcha. I would give this another go by creating an oauth token and using that as part of your credentials. I do think it's an issue that the ghprb plugin told you everything would be ok though, so I'm going to keep this issue open as a bug. |
Good idea, will give the oath token a try on monday. Thanks for the hint ;) |
By the way, i was adding the token using ghprb's button "create api token" in the configure section. Therefore i was not even thinking about creating a oauth token ;) |
I assume the underlying issue is now resolved and we can close this? If not, please reopen. |
Is there a link or help somewhere on exactly how to configure jenkins with 2fa in github? I've seen 3 different how-to sets of instructions and so far none of them work.. most just say "try turning off 2fa or using a different repo" none of which is a viable option. Instructions like this (https://blog.tentamen.eu/jenkins-and-github-integration-using-webhooks/) which say they will solve the issue do not.. there is no successful code pull for any reason. authentication fails. Using Oauth, with a private key and a webhook all at the same time still constantly fails. Any set of instructions that works with original jenkins (not blue ocean) would be great. Please not a link to another blog post saying it can be done or should work, but does someone have actual step by step that actually works? |
@mutabletao @nikolaycnpopov - I churned on the same issue for a while. CloudBees: GitHub Permissions and API token Scopes for Jenkins |
For some reason i cannot use an access token when 2fa on the given account is active.
i can see the token is used when i disable 2fa on that account
Jenkins GitHub Pull Request Builder — repo, repo:status -> Last used within the last day
with 2fa enabled i can still do curl requests on the url ghprb uses for triggering build jobs
curl -I -u my-user-name:my-access-token https://api.github.com/repos/my-org/my-repo/pulls?state=open
But jenkins fails
java.lang.Error: org.kohsuke.github.HttpException: Server returned HTTP response code: 401, message: 'Unauthorized' for URL: https://api.github.com/repos/my-org/my-repo/pulls?state=open
I can run all checks in the configure page of ghprb with success with the given access token
Connect to API
Connected to https://api.github.com as null (null) login: my-user-name
User has access to: Push, Pull
As soon as i deactivate 2fa everything works just fine, which isn't an option at all
Can anyone tell me if i am doing anything wrong or if this is a bug?
Thanks
The text was updated successfully, but these errors were encountered: