Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LinkedIn oauth fails at getting a request token #28

Open
Willooz opened this issue Oct 24, 2015 · 10 comments
Open

LinkedIn oauth fails at getting a request token #28

Willooz opened this issue Oct 24, 2015 · 10 comments

Comments

@Willooz
Copy link

Willooz commented Oct 24, 2015

Hi, I'm getting the following response from LinkedIn Oauth:
{"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 problem seems to happen at Step 3 — Exchange Authorization Code for a Request Token (https://developer.linkedin.com/docs/oauth2).

When I look at the request made by omniauth (lib/oauth2/client.rb)...

{:raise_errors=>true, :parse=>nil, :body=>{"grant_type"=>"authorization_code", "code"=>"AQRXa3pON-Dz2PeQiHesH0k0ENLI1M_NdcUY2Y5Gae7EpiRnBrwLcEBHqF5E9opvNqtqP5kRaXXweTJwyp8oJfv5yXEMUlotjuMTt2L80D6mTp8-cGw", "client_id"=>"XXX", "client_secret"=>"XXX", :redirect_uri=>"http://localhost:3000/auth/linkedin/callback?code=AQRXa3pON-Dz2PeQiHesH0k0ENLI1M_NdcUY2Y5Gae7EpiRnBrwLcEBHqF5E9opvNqtqP5kRaXXweTJwyp8oJfv5yXEMUlotjuMTt2L80D6mTp8-cGw&state=16ae401bac5b0c55eba2089cd964a9590d587e81545a226f"}, :headers=>{"Content-Type"=>"application/x-www-form-urlencoded"}}

...and compare with LinkedIn requirements for Step 3, the only difference I see is the redirect_uri encoding.

Could that be the problem? Can it be fixed? Has anyone else had that type of issue?

Thanks for helping!

@Willooz Willooz changed the title LinkedIn oauth fails at getting an access token LinkedIn oauth fails at getting an request token Oct 24, 2015
@Willooz Willooz changed the title LinkedIn oauth fails at getting an request token LinkedIn oauth fails at getting a request token Oct 24, 2015
@zmajstor
Copy link

you can try with quick fix in Gemfile: gem 'omniauth-oauth2', '1.3.1' if the problem is the same as here:
omniauth/omniauth#825 (comment)

@igrabes
Copy link

igrabes commented Oct 27, 2015

This worked for me. Thanks

@Willooz
Copy link
Author

Willooz commented Oct 27, 2015

It worked, thank you so much! 👍

@cristianogregnanin
Copy link

this work for me

@raouldevil
Copy link

This issue is still unresolved, encountered today, solved with @zmajstor fix. A long term solution would be great.

@colinexl
Copy link

colinexl commented Apr 3, 2016

this worked for me as well

@kumaresan-rails
Copy link

kumaresan-rails commented Jul 28, 2016

Was this issue resolved.? I am still facing the issue even after using gem 'omniauth-oauth2', '1.3.1.

@ashadev
Copy link

ashadev commented Aug 3, 2016

@kumaresan-rails Were you able to solve this issue? I'm facing the same even after using omniauth-oauth2 1.3.1.

@SoorajChandran
Copy link

Facing the same issue. Any solutions ?

@alexandru-calinoiu
Copy link

Looks like the issue is fixed on a commit on master 80f5f73

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants