0
votes

I'm using Rails and OAuth so users can sign in with LinkedIn. I'm following this tutorial http://www.sitepoint.com/rails-authentication-oauth-2-0-omniauth/. I registered my app on LinkedIn Developers and followed the instructions to a T. However when use localhost to test the app, and I'm navigated to the LinkedIn authorize page, I get this Action Controller error message as a callback:

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"}

What can I do to resolve this, so OAuth with LinkedIn works?Here is my code in omniauth.rb

1

1 Answers

0
votes

You can not set localhost directly as your callback. You can use 127.0.0.1:3000 instead of localhost to get it working.