ruby on rails 3 - OmniAuth - current session not loaded on OpenID callback -


i'm using omniauth rails 3.1.4 , i'm trying allow authenticated users associate multiple openid providers account.

as unauthenticated user, signing in openid works fine. authenticated user, when try sign in different oid provider, when callback method executed, looks wasn't authenticated.

to me looks controller gets executed before sessions initialised (or sessions skipped).

what be?

confirming andrei serdeliuc's solution, disabling protect_from_forgery worked me (ruby 1.8.7, rails 2.3.11, omniauth 0.1.6)

in callbackcontroller (authenticationscontroller in famous screencast) adding skip_before_filter :verify_authenticity_token or protect_from_forgery :except => :create @ top of controller work !

as way csrf (cross-site request forgery) should verify identity of openid server, don't forget setup certificate verification (in initializer):

# first of ca-bundle.crt file (eg : open-source browser package) require "openid/fetchers" openid.fetcher.ca_file = "#{rails.root}/config/ca-bundle.crt""

it prevent warnings :

warning: making https request https://www.google.com/accounts/o8/id  without verifying server certificate; no ca path specified.

now sessions not reseted anymore, , can add several openid authentication curren_user.

cheers


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -