What correct configuration line should be designed, omniauth and google work?

I looked through the documentation and I cannot figure out the specific line that I have to use in order to get a good + omniauth + google development.

This strategy file offers an easy way to do this, but I cannot find an example.

https://github.com/intridea/omniauth/blob/master/oa-oauth/lib/omniauth/strategies/google.rb

I am currently using the line below in the devise.rb initialization file.

config.omniauth :google, GOOGLE_APP_ID, GOOGLE_SECRET_KEY

but I am sure that it is incomplete.

Also, I'm struggling to find where I have to register for the google app id and secret key.

Thanks in advance. Graeme

+3
source share
4 answers

, , ...

config.omniauth :google, GOOGLE_APP_ID, GOOGLE_SECRET, :scope => "http://www.google.com/m8/feeds http://picasaweb.google.com/data/"

, , Picasa, .

+2

Google - . :

provider :openid, OpenID::Store::Filesystem.new('./tmp'), :name => 'google', :identifier => 'https://www.google.com/accounts/o8/id'
+2

https://github.com/holden/devise-omniauth-example. , user.rb, user_token, devise.rb. , , , devise/omniauth google openid: config.omniauth :google_apps, OpenID::Store::Filesystem.new('/tmp'), :domain => 'gmail.com' , :)

+1

omniauth.rb, :

Rails.application.config.middleware.use OmniAuth::Builder do  
   provider :openid, nil, :name => 'google', :identifier =>'https://www.google.com/accounts/o8/id'  
end
0

Source: https://habr.com/ru/post/1792550/


All Articles