skip to Main Content

Context:

I’m developing a "login with LinkedIn" feature on Laravel 11 using socialite. This requires 2 endpoints:

  1. One that redirects the user to a LinkedIn login page
  2. One that LinkedIn redirects to if login was successful

Expected vs. Actual Behavior:

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:
LinkedIn developer account redirect url settings

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


  1. 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.

    Login or Signup to reply.
  2. Same issue from my side today ! But it still works in some regions

    Login or Signup to reply.
  3. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search