-
Notifications
You must be signed in to change notification settings - Fork 737
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
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 |
@@ -132,24 +130,24 @@ public static GitHub connect() throws IOException { | |||
* "http://ghe.acme.com/api/v3". Note that GitHub Enterprise has <tt>/api/v3</tt> in the URL. | |||
* For historical reasons, this parameter still accepts the bare domain name, but that's considered deprecated. | |||
*/ | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.