Tags

, ,

If you’re using a Devise gem and the latest Omniauth Oauth2(1.4.0) for authentication chances are you may encounter an errors below:

Facebook:
ERROR — omniauth: (facebook) Authentication failure! invalid_credentials: >OAuth2::Error, : {“error”:{“message”:”Error validating verification code. Please make sure your >redirect_uri is identical to the one you used in the OAuth dialog request”,”type”:”OAuthException”,”code”:100,”fbtrace_id”:”XXXXXXXXXX”}}

LinkedIn:
ERROR — omniauth: (linkedin) Authentication failure! invalid_credentials: >OAuth2::Error, invalid_request: missing required parameters, includes an invalid parameter value, parameter more than once. : Unable to retrieve access token : appId or redirect uri does not match authorization code or authorization code expired {“error_description”:”missing required parameters, includes an invalid parameter value, parameter more than once. : Unable to retrieve access token : appId or redirect uri does not match authorization code or authorization code expired”,”error”:”invalid_request”}

Google
ERROR — omniauth: (google_oauth2) Authentication failure! invalid_credentials: >OAuth2::Error, redirect_uri_mismatch: { “error” : “redirect_uri_mismatch” }

Solution:
We need to update the Gemfile and add this line:
gem ‘omniauth-oauth2’, ‘~> 1.3.1’.
Then run the command: bundle update

Advertisements