Skip to content

Commit

Permalink
Set OAuth2::Client::options[:auth_scheme] to :basic_auth, as OAuth2 g…
Browse files Browse the repository at this point in the history
…em does not yet make this the default.

Add test to verify auth_scheme is :basic_auth.
  • Loading branch information
ginjo committed Aug 31, 2018
1 parent 2a3d071 commit a2db8be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/omniauth/strategies/slack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ class Slack < OmniAuth::Strategies::OAuth2

option :client_options, {
site: 'https://slack.com',
token_url: '/api/oauth.access'
token_url: '/api/oauth.access',
auth_scheme: :basic_auth
}

option :auth_token_params, {
Expand Down
4 changes: 4 additions & 0 deletions test/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ class ClientTest < StrategyTestCase
test "has correct token url" do
assert_equal "/api/oauth.access", strategy.client.options[:token_url]
end

test "has correct auth_scheme" do
assert_equal :basic_auth, strategy.client.options[:auth_scheme]
end

test 'request logs api call' do
OAuth2::Client.class_eval do
Expand Down

0 comments on commit a2db8be

Please sign in to comment.