From d403418b508ac7a928d2a36368ef5b96a4e6916b Mon Sep 17 00:00:00 2001 From: Phil Spitler Date: Tue, 18 Oct 2011 14:20:13 -0400 Subject: [PATCH] added authorize_params to monkeypatch in google strategy --- oa-oauth/lib/omniauth/strategies/oauth/google.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/oa-oauth/lib/omniauth/strategies/oauth/google.rb b/oa-oauth/lib/omniauth/strategies/oauth/google.rb index 6470347..54ce692 100644 --- a/oa-oauth/lib/omniauth/strategies/oauth/google.rb +++ b/oa-oauth/lib/omniauth/strategies/oauth/google.rb @@ -59,9 +59,12 @@ module OmniAuth @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