diff --git a/lib/omniauth/strategies/gplus.rb b/lib/omniauth/strategies/gplus.rb index 67f929d..4cd5a31 100644 --- a/lib/omniauth/strategies/gplus.rb +++ b/lib/omniauth/strategies/gplus.rb @@ -7,7 +7,7 @@ class GPlus < OAuth2 token_url: 'https://www.google.com/accounts/o8/oauth2/token' } - option :scope, 'email' + option :scope, 'userinfo.email' option :uid_field, :uid @@ -51,7 +51,7 @@ def format_scopes(scopes) end def format_scope(scope) - "https://www.googleapis.com/auth/userinfo.#{scope}" + "https://www.googleapis.com/auth/#{scope}" end def custom_parameters(params) diff --git a/test/lib/omniauth/strategies/gplus_test.rb b/test/lib/omniauth/strategies/gplus_test.rb index fde23f6..81e2deb 100644 --- a/test/lib/omniauth/strategies/gplus_test.rb +++ b/test/lib/omniauth/strategies/gplus_test.rb @@ -31,7 +31,7 @@ def test_token_url_is_valid end def test_default_scope_is_email - expected = 'email' + expected = 'userinfo.email' actual = strategy.options['scope'] assert_equal(expected, actual) end