Skip to content

Stop using deprecated API tokens for Enterprise#33

Merged
kohsuke merged 4 commits into
hub4j:masterfrom
watsonian:fix-enterprise
Apr 23, 2013
Merged

Stop using deprecated API tokens for Enterprise#33
kohsuke merged 4 commits into
hub4j:masterfrom
watsonian:fix-enterprise

Conversation

@watsonian

Copy link
Copy Markdown

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.

Authentication by API token is deprecated and doesn't work anymore.
Instead, authentication should be done via OAuth token now.
@buildhive

Copy link
Copy Markdown

Kohsuke Kawaguchi » github-api #69 FAILURE
Looks like there's a problem with this pull request
(what's this?)

@buildhive

Copy link
Copy Markdown

Kohsuke Kawaguchi » github-api #70 SUCCESS
This pull request looks good
(what's this?)

@buildhive

Copy link
Copy Markdown

Kohsuke Kawaguchi » github-api #71 FAILURE
Looks like there's a problem with this pull request
(what's this?)

@buildhive

Copy link
Copy Markdown

Kohsuke Kawaguchi » github-api #72 SUCCESS
This pull request looks good
(what's this?)

@kohsuke kohsuke merged commit da1405a into hub4j:master Apr 23, 2013
@watsonian watsonian deleted the fix-enterprise branch April 23, 2013 18:03
*/
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 {

@iraleigh iraleigh Oct 24, 2017

Copy link
Copy Markdown

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.

@watsonian @kohsuke

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants