6

I'm trying to link my Jenkins server with a github project. When setting up a multibranch pipeline job with GitHub as Source and adding my credentials I get the following error:

Invalid credentials: https://api.github.com/user {"message":"Requires authentication","documentation_url":"https://docs.github.com/rest/reference/users#get-the-authenticated-user"}

I checked my credentials and they are in fact correct. What could be the problem?

In the configuration, I added the https://api.github.com as a GitHub server. There I checked my GPAT credentials and they work.

enter image description here

Vivere
  • 1,919
  • 4
  • 16
  • 35

1 Answers1

2

I ran into the same issue. This thread was helpful: https://stackoverflow.com/a/61105369/13483935

Apparently you can not use the same username as the github account, once I changed the username to something other than my github username it worked.

  • I forgot what I needed that GPAT, although I remember the error had absolutely no sense. From reading that thread, I think I was right. I'm now using SSH for my Jenkins connection. – Vivere Apr 19 '21 at 18:10