Skip to content

Commit

Permalink
Merge pull request #7 from batalla3692/change-token-method
Browse files Browse the repository at this point in the history
Change request method strategy when validating access token
  • Loading branch information
jclusso authored Sep 19, 2024
2 parents 383ab9a + 9f28014 commit 14a37c4
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/linkedin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ class LinkedIn < OmniAuth::Strategies::OAuth2
option :client_options, {
:site => 'https://api.linkedin.com',
:authorize_url => 'https://www.linkedin.com/oauth/v2/authorization?response_type=code',
:token_url => 'https://www.linkedin.com/oauth/v2/accessToken'
:token_url => 'https://www.linkedin.com/oauth/v2/accessToken',
:token_method => :post_with_query_string
}

option :scope, 'openid profile email'
Expand Down
4 changes: 4 additions & 0 deletions spec/omniauth/strategies/linkedin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
it 'has correct `token_url`' do
expect(subject.client.options[:token_url]).to eq('https://www.linkedin.com/oauth/v2/accessToken')
end

it 'has a correct `token_method`' do
expect(subject.client.options[:token_method]).to eq(:post_with_query_string)
end
end

describe '#callback_path' do
Expand Down

0 comments on commit 14a37c4

Please sign in to comment.