Search code examples
phplaravellaravel-5.3linkedin-apilaravel-socialite

linkedin api 400 bad request


I am using socialite. And trying to integrate linkedin. It is OK when a user ALLOW the request. But, I get the following error when a user cancel the request.

enter image description here

Why am I getting this error?


Solution

  • Look at the steps here: https://developer.linkedin.com/docs/oauth2.

    Look at Step 3 — Exchange Authorization Code for an Access Token

    The final step towards obtaining an Access Token is for your application to ask for one using the Authorization Code it just acquired. This is done by making the following "x-www-form-urlencoded" HTTP POST request.