atmos / warden-github

:lock: warden strategy for github oauth
MIT License
54 stars 41 forks source link

use github_api_uri method instead of hardcoded github api uri. #16

Closed chobie closed 11 years ago

chobie commented 11 years ago

Hi, Thanks sharing useful gem.

I encountered RestClient::Unauthorized exception on our Github Enterprise site. I took a look codes and I found Warden::Github::Oauth::User has github_api_uri. so i just copy it to strategy.rb

Unfortunately, I'm poor about ruby experience so I'm not sure this is the good solution.

Regards,

atmos commented 11 years ago

Any idea if octokit takes into account this environmental variable or something similar?

https://github.com/chobie/warden-github/blob/58aa2feb9eba5e5756706913f04f05e42727a3d3/lib/warden-github/user.rb#L111

/cc @pengwynn @sferik

pengwynn commented 11 years ago

Octokit supports a couple of ENV vars for this out of the box.

atmos commented 11 years ago

I released 0.12.1 with support for GitHub Enterprise. Note that the environmental variable in use now is OCTOKIT_API_ENDPOINT instead of the one you provided. This helps consolidate GH:E usage if you want to make API calls off of the warden user too.