Skip to content

Cannot use an access token when 2fa is active #458

Closed

Description

For some reason i cannot use an access token when 2fa on the given account is active.

  1. 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

  2. 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

  3. 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

  4. I can run all checks in the configure page of ghprb with success with the given access token

    • Test basic connection to GitHub
      Connect to API
      Connected to https://api.github.com as null (null) login: my-user-name
    • Test Permissions to a Repository
      User has access to: Push, Pull
  5. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions