Skip to content

Commit

Permalink
Merge pull request #508 from philspitler/0-3-stable
Browse files Browse the repository at this point in the history
0-3-Stable: Resolved issue adding authorize_params to google strategy.
  • Loading branch information
Michael Bleigh committed Oct 18, 2011
2 parents 2447925 + d403418 commit d9d9e9d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions oa-oauth/lib/omniauth/strategies/oauth/google.rb
Expand Up @@ -59,9 +59,12 @@ def user_hash
@user_hash ||= MultiJson.decode(@access_token.get('https://www.google.com/m8/feeds/contacts/default/full?max-results=1&alt=json').body)
end

# Monkeypatch OmniAuth to pass the scope in the consumer.get_request_token call
# Monkeypatch OmniAuth to pass the scope and authorize_params in the consumer.get_request_token call
def request_phase
request_token = consumer.get_request_token({:oauth_callback => callback_url}, {:scope => options[:scope]})
request_options = {:scope => options[:scope]}
request_options.merge!(options[:authorize_params])

request_token = consumer.get_request_token({:oauth_callback => callback_url}, request_options)
session['oauth'] ||= {}
session['oauth'][name.to_s] = {'callback_confirmed' => request_token.callback_confirmed?, 'request_token' => request_token.token, 'request_secret' => request_token.secret}
r = Rack::Response.new
Expand Down

0 comments on commit d9d9e9d

Please sign in to comment.