Dear Fine People of SO:
I'm developing a Ruby app on Rails 3.2.12 (and I'm still new to it).
I'm trying to get Devise working with Omniauth... the first strategy I'm trying is Google_oauth2.
I have it working to the point where Google has redirected back into my localhost:3000 instance after selecting the credentials I want to use in Google.
Upon this redirection back into localhost, I see a flash notice:
Could not authenticate you from GoogleOauth2 because "Csrf detected".
The server logs contain this:
Started GET "/users/auth/google_oauth2" for 127.0.0.1 at 2013-03-21 08:57:01 -0400
(google_oauth2) Callback phase initiated.
(google_oauth2) Callback phase initiated.
(google_oauth2) Authentication failure! invalid_credentials: OmniAuth::Strategie
s::OAuth2::CallbackError, OmniAuth::Strategies::OAuth2::CallbackError
Started GET "/users/auth/google_oauth2/callback?state=7849a3762d07e7f89e69b4aa46
7efc7b7b2c21655193396b&code=4/v-dSBwAvQUUZL87iNV_yk_Z8s_x0.cnqsdbDX4gUYaDn_6y0ZQ
NgQ9hAaewI" for 127.0.0.1 at 2013-03-21 08:57:40 -0400
Processing by OmniauthCallbacksController#failure as HTML
Parameters: {"state"=>"7849a3762d07e7f89e69b4aa467efc7b7b2c21655193396b", "cod
e"=>"4/v-dSBwAvQUUZL87iNV_yk_Z8s_x0.cnqsdbDX4gUYaDn_6y0ZQNgQ9hAaewI"}
Redirected to http://localhost:3000/users/sign_in
Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
I noticed that I get exactly the same result if I simply put the callback URL into the browser directly, without any parameters supplied.
http://localhost:3000/users/auth/google_oauth2/callback
What can I try? What other info can I provide? Help me help you help me ;)