Skip to content

Commit 032c21f

Browse files
committed
Merge pull request #19 from jash/auth_token_params
Add auth_token_params as an option when getting a token
2 parents 89c44d8 + 41bb7e6 commit 032c21f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/omniauth/strategies/oauth2.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class OAuth2
2424
option :authorize_options, [:scope]
2525
option :token_params, {}
2626
option :token_options, []
27+
option :auth_token_params, {}
2728
option :provider_ignores_state, false
2829

2930
attr_accessor :access_token
@@ -96,7 +97,7 @@ def deep_symbolize(hash)
9697

9798
def build_access_token
9899
verifier = request.params['code']
99-
client.auth_code.get_token(verifier, {:redirect_uri => callback_url}.merge(token_params.to_hash(:symbolize_keys => true)))
100+
client.auth_code.get_token(verifier, {:redirect_uri => callback_url}.merge(token_params.to_hash(:symbolize_keys => true)), deep_symbolize(options.auth_token_params))
100101
end
101102

102103
# An error that is indicated in the OAuth 2.0 callback.

0 commit comments

Comments
 (0)