Skip to content
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

Merged
merged 4 commits into from
Apr 23, 2013
Merged

Stop using deprecated API tokens for Enterprise #33

merged 4 commits into from
Apr 23, 2013

Conversation

watsonian
Copy link

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

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

@buildhive
Copy link

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

@buildhive
Copy link

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

@buildhive
Copy link

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
@@ -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 {
Copy link

@iraleigh iraleigh Oct 24, 2017

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