Unable to obtain LinkedIn Access Token using Authorization Code
Asked Answered
J

0

7

I am unable to obtain a LinkedIn Access Token. My setup is as follows:

  1. I have setup an app on LI with this redirect URL http://localhost:5000/home

  2. I request authorization from LI and get a response with the 'code'.

  3. In under 10 seconds, I copy the code query param out of the URL bar and paste it into Postman.

  4. In Postman, I have a setup as follows:

    POST /oauth/v2/accessToken HTTP/1.1
    Host: www.linkedin.com
    Content-Type: application/x-www-form-urlencoded
    
    grant_type=authorization_code&
    client_id=<client id>&
    client_secret=<client secret>&
    redirect_uri=http%3A%2F%2Flocalhost%3A5000%2Fhome&
    code=AQSbUzcWwSk_3sqQfusRZWEa4tZqU_x4fSQKub9c3eoeCzZwNO2ZH8uAzJc-T0T40WRv6qNxNpCDxckEjuXHqb56ZhKQqReB5mDjm1kZrCrLlBBYhzyymF5oRzwNgObylJukUVQ_0OiSuE0W0RQ
    

I have made multiple attempts but in response, I get the following error.

{"error":"invalid_request","error_description":"Unable to retrieve access token: appid/redirect uri/code verifier does not match authorization code. Or authorization code expired. Or external member binding exists"}

We have a LI login deployment that suddenly stopped working and started returning this error. On simplifying the use case, I find that Postman does the same.

What gives? What am I doing wrong? This used to work!

Jewelry answered 12/9, 2017 at 0:17 Comment(6)
Did you find a solution for this @Goat? I have this exact issueSwanee
@Jewelry Did you get the solution?Scoundrelly
Same issue here. Microsoft, what a wonderful company :)Ingold
If I remember correctly, it fixed itself at the time. It was a LinkedIn issue. Turned out we were doing nothing wrong.Jewelry
Any solution guys?Wixted
It's likely a LinkedIn issue. It'll resolve itself.Jewelry

© 2022 - 2024 — McMap. All rights reserved.