Hi, I have a query with Laravel Socialite Package.
I am facing problem only for LinkedIn as it was working fine before.
Getting problem when LinkedIn remove auth1 support. I am using laravel 5.8 version with 4.1 socialite.
I got following error message
Client error: POST https://www.linkedin.com/oauth/v2/accessToken resulted in a 400 Bad Request response:
{"error":"invalid_request","error_description":"A required parameter "code" is missing"}
If someone comes across this thread and is wondering:
I'm not 100% sure if it's the only cause but this definitely happens if a user cancels the Linkedin Login. The user gets redirected back. After that laravel tries to issue an Request but has no code so the API Error appears.
Easy fix is to just try/catch the Socialite::driver('linkedin')->user();
Hi,
Please let me know anyone fixes this issue. I am getting the same error
Client error: POST https://www.linkedin.com/oauth/v2/accessToken resulted in a 400 Bad Request response: {"error":"invalid_request","error_description":"A required parameter "code" is missing"}
Try this tutorial, it's work for me.
I'm sorry i can't include the link because i'm already sign up Laracast today.
You can found the tutorial in your search engine using keyword "How to Get SignIn with LinkedIn to work" with author Taric A. as a product manager from LinkedIn.
The main problem is beacuse you haven't activated "Sign In with LinkedIn" product on your application.
@iffikhan you should update your services in config/services.php to 'linkedin-openid' => [...] also the redirect function : return Socialite::driver('linkedin-openid')->redirect(); it works for me
User Driver Provider name (linkedin-openid)
return Socialite::driver('linkedin-openid')->scopes(['w_member_social','openid','profile','email'])->redirect();
Note: In scopes use scope parameter from your linkedin account
same as change in config/services.php
if you use provider name (linkedin) change to (linkedin-openid)
'linkedin-openid' => [
'client_id' => env('LINKEDIN_CLIENT_ID'),
'client_secret' => env('LINKEDIN_SECRET_ID'),
'redirect' => env('LINKEDIN_REDIRECT_URL'),
],