I'm trying to get the Linkedin access token by Omniauth, using Devise, Omniauth and omniauth-linkedin-oauth-2. Either with facebook and twitter, I can get the access token, but when I try it with linkedin, I'm getting the following error in the omniauth callback:
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"}
The linkedin app id and secret authentication is working, as I'm getting the callback on omniauth, the thing is I can't realise what the problem is here.
Devise config below:
config.omniauth :linkedin, ENV['LINKEDIN_APP_ID'], ENV['LINKEDIN_APP_SECRET']
Any ideas on what could be happening?
http://localhost:3000/users/auth/linkedin/callback
in the Authorized Redirect URLs of the Linkedin app – Vicechancelloromniauth-linkedin-oauth2
? Looking at my code I had to do this:config.omniauth :linkedin, ENV["LINKEDIN_KEY"], ENV["LINKEDIN_SECRET"], :scope => 'r_basicprofile r_emailaddress', :fields => ['id', 'email-address', 'first-name', 'last-name', 'headline', 'industry', 'picture-url', 'public-profile-url']
– Cuprumomniauth-linkedin-oauth2
and I tried with your config line and still no luck... – Vicechancellor