Class: OmniAuth::Strategies::Google2
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Google2
- Defined in:
- lib/omniauth/strategies/google2.rb
Overview
OmniAuth strategy for Google OAuth2/OpenID Connect.
Direct Known Subclasses
Constant Summary collapse
- BASE_SCOPE_URL =
"https://www.googleapis.com/auth/"- BASE_SCOPES =
%w[openid email profile].freeze
- DEFAULT_SCOPE =
"openid email profile"- USER_INFO_URL =
"https://openidconnect.googleapis.com/v1/userinfo"
Instance Method Summary collapse
- #authorize_params ⇒ Object
-
#callback_url ⇒ Object
Ensure token exchange uses a stable callback URI that matches provider config.
-
#query_string ⇒ Object
Prevent authorization response params from being appended to redirect_uri.
- #raw_info ⇒ Object
Instance Method Details
#authorize_params ⇒ Object
69 70 71 72 73 74 75 76 77 |
# File 'lib/omniauth/strategies/google2.rb', line 69 def super.tap do |params| (params) params[:scope] = normalize_scope(params[:scope] || [:scope]) params[:access_type] ||= "offline" params[:include_granted_scopes] = normalize_include_granted_scopes(params[:include_granted_scopes]) (params) end end |
#callback_url ⇒ Object
Ensure token exchange uses a stable callback URI that matches provider config.
84 85 86 |
# File 'lib/omniauth/strategies/google2.rb', line 84 def callback_url [:callback_url] || [:redirect_uri] || super end |
#query_string ⇒ Object
Prevent authorization response params from being appended to redirect_uri.
89 90 91 92 93 |
# File 'lib/omniauth/strategies/google2.rb', line 89 def query_string return "" if request.params["code"] super end |
#raw_info ⇒ Object
79 80 81 |
# File 'lib/omniauth/strategies/google2.rb', line 79 def raw_info @raw_info ||= access_token.get(USER_INFO_URL).parsed end |