intridea/omniauth — Issue #570: sessions mixing up.
Author: akil-rails
Created: 2012-01-28 10:49:24+00:00
State: open

I used omniauth + devise as described in rails casts - http://railscasts.com/episodes/235-omniauth-part-1.
I have 30 providers listed in omniauth.rb (all google apps) -

require 'openid/store/filesystem'
Rails.application.config.middleware.use OmniAuth::Builder do

provider :google_apps, OpenID::Store::Filesystem.new('/tmp'), :name => 'wf', :domain => 'wf.justbooksclc.com'
provider :google_apps, OpenID::Store::Filesystem.new('/tmp'), :name => 'jpn', :domain => 'jpn.justbooksclc.com'
provider :google_apps, OpenID::Store::Filesystem.new('/tmp'), :name => 'bll', :domain => 'bll.justbooksclc.com'
provider :google_apps, OpenID::Store::Filesystem.new('/tmp'), :name => 'in', :domain => 'in.justbooksclc.com'
provider :google_apps, OpenID::Store::Filesystem.new('/tmp'), :name => 'kn', :domain => 'kn.justbooksclc.com'
provider :google_apps, OpenID::Store::Filesystem.new('/tmp'), :name => 'hsr', :domain => 'hsr.justbooksclc.com'
provider :google_apps, OpenID::Store::Filesystem.new('/tmp'), :name => 'ft', :domain => 'ft.justbooksclc.com'
provider :google_apps, OpenID::Store::Filesystem.new('/tmp'), :name => 'kor', :domain => 'kor.justbooksclc.com'
.....

All works fine 99.999% of the time, but in a few cases, my users complaint that they got logged in as another user, and from a different domain. For example, a user from wf.justbooksclc.com gets logged in as a user from hsr.justbooksclc.com. The user names are different!. I know that this is true, since the user names and passwords aren't shared, ( the domains are across users in different cities).

Can you please help me figure out what could be wrong?