Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

allow the oauth provider hostname to be overridden

  • Loading branch information...
commit def5ceb5732d88aeb2bea7e396c1a900a47b3d2b 1 parent 8de4f42
@atmos atmos authored
View
8 lib/warden-github/proxy.rb
@@ -2,9 +2,9 @@ module Warden
module Github
module Oauth
class Proxy
- attr_accessor :client_id, :secret, :scopes, :callback_url
- def initialize(client_id, secret, scopes, callback_url)
- @client_id, @secret, @scopes, @callback_url = client_id, secret, scopes, callback_url
+ attr_accessor :client_id, :secret, :scopes, :oauth_domain, :callback_url
+ def initialize(client_id, secret, scopes, oauth_domain, callback_url)
+ @client_id, @secret, @scopes, @oauth_domain, @callback_url = client_id, secret, scopes, oauth_domain, callback_url
end
def ssl_options
@@ -19,7 +19,7 @@ def ssl_options
def client
@client ||= OAuth2::Client.new(@client_id, @secret,
:ssl => ssl_options,
- :site => 'https://github.com',
+ :site => oauth_domain,
:token_url => '/login/oauth/access_token',
:authorize_url => '/login/oauth/authorize')
end
View
1  lib/warden-github/strategy.rb
@@ -43,6 +43,7 @@ def oauth_proxy
@oauth_proxy ||= Warden::Github::Oauth::Proxy.new(env['warden'].config[:github_client_id],
env['warden'].config[:github_secret],
env['warden'].config[:github_scopes],
+ env['warden'].config[:github_oauth_domain],
callback_url)
end
View
2  lib/warden-github/version.rb
@@ -1,5 +1,5 @@
module Warden
module Github
- VERSION = "0.3.1"
+ VERSION = "0.4.0"
end
end
View
1  spec/app.rb
@@ -14,6 +14,7 @@ class App < Sinatra::Base
manager[:github_secret] = ENV['GITHUB_CLIENT_SECRET'] || 'ed8ff0c54067aefb808dab1ca265865405d08d6f'
manager[:github_scopes] = ''
+ manager[:github_oauth_domain] = ENV['GITHUB_OAUTH_DOMAIN'] || 'https://github.com'
manager[:github_callback_url] = '/auth/github/callback'
end
Please sign in to comment.
Something went wrong with that request. Please try again.