sishen / omniauth-google-apps

OmniAuth strategy for Google Apps.
http://github.com/sishen/omniauth-google-apps
43 stars 17 forks source link

OpenID2 for Google accounts is going away on April 20, 2015 #13

Closed trueinviso closed 9 years ago

trueinviso commented 9 years ago

Sorry if this is the wrong place to ask this question:

I can't seem to find anything about migrating away from openid for omniauth-google-apps users? Is this as simple as changing the redirect url?

require "openid/store/filesystem" require "omniauth-google-oauth2" config.omniauth :google_apps, store: OpenID::Store::Filesystem.new('/tmp'), domain: "example.com", identifier: "https://www.google.com/accounts/o8/id"

melchiorx commented 9 years ago

Hi, I'm also interested in seeing if there is any movement on this. Perhaps we can modify and submit as the repo hasn't been active in almost one year?

trueinviso commented 9 years ago

I ended up using gem omniauth-google-oauth2.

I set up my omniauth.rb initializer like this: provider :google_oauth2, ENV['GOOGLE_CLIENT_ID'], ENV['GOOGLE_CLIENT_SECRET'], { :scope => "email, profile" } OmniAuth.config.full_host = "http://example.com"

I had to register my app on google developer console, this is where I got the client_id and client_secret, under API's & Auth -> Credentials. There are tutorials on how to set this up, but it's pretty easy.

This is also where you set up your redirect URI's. I set mine up here with callback on the end. Then used it in my app like this: redirect_to "/auth/google_oauth2" unless current_user

I was able to leave everything else in my app the same as I was using it for OpenID.

sishen commented 9 years ago

@trueinviso Thank you for the info. I have added a notice to the README to recommend others to use omniauth-google-oauth2 instead.