Skip to content

Commit eaa9442

Browse files
committed
Add auth_token_params as an option when getting a token
1 parent e82ed5d commit eaa9442

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

2829
attr_accessor :access_token
2930

@@ -97,7 +98,7 @@ def deep_symbolize(hash)
9798

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

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

0 commit comments

Comments
 (0)