Stop using deprecated API tokens for Enterprise#33
Conversation
Authentication by API token is deprecated and doesn't work anymore. Instead, authentication should be done via OAuth token now.
|
Kohsuke Kawaguchi » github-api #69 FAILURE |
|
Kohsuke Kawaguchi » github-api #70 SUCCESS |
|
Kohsuke Kawaguchi » github-api #71 FAILURE |
|
Kohsuke Kawaguchi » github-api #72 SUCCESS |
| */ | ||
| public static GitHub connectToEnterprise(String apiUrl, String login, String apiToken) { | ||
| return new GitHub(apiUrl,login,apiToken,null); | ||
| public static GitHub connectToEnterprise(String apiUrl, String oauthAccessToken) throws IOException { |
There was a problem hiding this comment.
I know that this is late, because this has already been merged. There is a problem with removing the login parameter makes this connection fail. From my understanding the login and OAuth are associated with each other, an OAuth cannot be used to authenticate by itself.
I see the call to getMyself(), but I am confused about the source of truth for "myself". If you have not explicitly set "myself" with the login, how can you call getMyself() for the login.
Authentication by API token is deprecated and doesn't work anymore. Instead, authentication should be done via OAuth token now. This is causing the GitHub plugin to fail when trying to setup Jenkins to auto-manage web hooks and will just be breaking in general for anyone trying to use this with Enterprise.
I'm not much of a Java guy, so I'd appreciate a look over this to make sure it works.