I’m using Devise & Omniauth on my rails 3.0.7 app, and I’ve already set up a functioning twitter and facebook logins. I just got Google Apps login working through omniauth with the following lines in config/initializers/omniauth.rb:
require 'openid/store/filesystem'
use OmniAuth::Strategies::GoogleApps, OpenID::Store::Filesystem.new('/tmp')
provider :openid, OpenID::Store::Filesystem.new('./tmp'), :name => 'google', :identifier => 'https://www.google.com/accounts/o8/id'
But this leads to a login with Google Apps. How do I just allow users to log in with their standard google accounts, not Google Apps (which is for corporates)? Is that even supported by Omniauth?
I’ve implemented this as a gem. If you’re interested you can use the gem itself or explore its source code. It’s pretty simple.
This is the engine file which configures devise. To support standard google accounts in your code you need to specify the
:domainoption as pointed out here