Issue
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.
Solution
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.
Answered By - Tristan Blandford