shubhangi singh
shubhangi singh

Reputation: 2920

custom omniauth client- Authentication failure! csrf_detected: OmniAuth::Strategies::OAuth2::CallbackError, csrf_detected | CSRF detected

trying to create a custom omniauth client to interact with api base rails app , the provider app is working perfectly with devise and doorkeeper integrated ApiProvider app on trying to authorize the client app using doorkeeper ui I am getting following error in console

I, [2017-01-17T15:37:31.760972 #13511]  INFO -- omniauth: (api_provider) Callback phase initiated.
E, [2017-01-17T15:37:31.767541 #13511] ERROR -- omniauth: (api_provider) Authentication failure! csrf_detected: OmniAuth::Strategies::OAuth2::CallbackError, csrf_detected | CSRF detected
E, [2017-01-17T15:37:31.767730 #13511] ERROR -- omniauth: (api_provider) Authentication failure! invalid_credentials: OmniAuth::Strategies::OAuth2::CallbackError, csrf_detected | CSRF detected

csrf_detected | CSRF detected

Upvotes: 3

Views: 1481

Answers (1)

Aqsa Altaf
Aqsa Altaf

Reputation: 1

In the file devise.rb add this line:

config.omniauth :google_oauth2, ENV['GOOGLE_CLIENT_ID'], ENV['GOOGLE_CLIENT_SECRET'],scope: 'email,profile,openid', provider_ignores_state: true

Upvotes: 0

Related Questions