Context:
I’m developing a "login with LinkedIn" feature on Laravel 11 using socialite. This requires 2 endpoints:
- One that redirects the user to a LinkedIn login page
- One that LinkedIn redirects to if login was successful
Expected vs. Actual Behavior:
- Expected: After logging into LinkedIn, I should be redirected back to my app’s URL.
- Actual: After a successful LinkedIn login, I’m stuck on a blank screen with the following URL:
https://www.linkedin.com/oauth/v2/login-success?app_id=223222338&auth_type=AC&flow=%7B%22state%22%3A%22nyjguHjmyBKUABGUwXTQdEGNjzI8jZzLofZlWwTk%22%2C%22creationTime%22%3A1734052104859%2C%22appId%22%3A223222338%2C%22authorizationType%22%3A%22OAUTH2_AUTHORIZATION_CODE%22%2C%22redirectUri%22%3A%22http%3A%2F%2Flocalhost%3A5173%2Flinkedin%2Fcallback%22%2C%22currentStage%22%3A%22LOGIN_SUCCESS%22%2C%22currentSubStage%22%3A0%2C%22authFlowName%22%3A%22generic-permission-list%22%2C%22scope%22%3A%22openid+profile+email%22%7D
I have checked that my application is configured with the correct redirect url. See my services.php
below:
'linkedin-openid' => [
'client_id' => env('LINKEDIN_CLIENT_ID'),
'client_secret' => env('LINKEDIN_CLIENT_SECRET'),
'redirect' => 'http://localhost:5173/linkedin/callback',
]
I have also double checked if this same url is configured in my app in my developer account:
And finally, this is my service that creates the url that takes the user to the LinkedIn login page:
class LinkedInAuthLinkService
{
public function execute(): string
{
$state = Str::random(40);
Cache::put("linkedin_state_{$state}", auth()->id(), now()->addMinutes(60));
return Socialite::driver(SocialProviders::LINKEDIN)
->stateless()
->with(['state' => $state])
->redirect()
->getTargetUrl();
}
}
I tried to reach out to LinkedIn support but they said I should post this on Stack Overflow.
3
Answers
I am also experiencing the same issue on Python with Flask, so I’m wondering if there is some issue on LinkedIn’s side. This is the same result when tested with Postman as well.
Same issue from my side today ! But it still works in some regions
We are also experiencing a similar issue from yesterday and is there any other way to reach out to LinkedIn support? The URL https://linkedin.zendesk.com/hc/en-us/ I got from support is also not working where we are struck post signIn