Class: Omniauth::Rails::Provider::GoogleOauth2
- Inherits:
-
Object
- Object
- Omniauth::Rails::Provider::GoogleOauth2
- Defined in:
- lib/omniauth/rails/provider/google_oauth2.rb
Overview
See more info here: github.com/zquestz/omniauth-google-oauth2/blob/master/README.md
Instance Method Summary collapse
- #client_id ⇒ Object
- #client_secret ⇒ Object
- #configure ⇒ Object
-
#initialize(config) ⇒ GoogleOauth2
constructor
A new instance of GoogleOauth2.
- #params ⇒ Object
Constructor Details
#initialize(config) ⇒ GoogleOauth2
Returns a new instance of GoogleOauth2.
8 9 10 11 |
# File 'lib/omniauth/rails/provider/google_oauth2.rb', line 8 def initialize(config) @config = config validate! end |
Instance Method Details
#client_id ⇒ Object
13 14 15 |
# File 'lib/omniauth/rails/provider/google_oauth2.rb', line 13 def client_id config["client_id"] end |
#client_secret ⇒ Object
17 18 19 |
# File 'lib/omniauth/rails/provider/google_oauth2.rb', line 17 def client_secret config["client_secret"] end |
#configure ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/omniauth/rails/provider/google_oauth2.rb', line 29 def configure this_provider = self ::Rails.application.config.middleware.use OmniAuth::Builder do provider( :google_oauth2, this_provider.client_id, this_provider.client_secret, this_provider.params, ) end end |
#params ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/omniauth/rails/provider/google_oauth2.rb', line 21 def params { access_type: "online", approval_prompt: "auto", # prompt: "none", # none, consent, select_account } end |