Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

TheRabber's avatar

Laravel Socialite Zitadel

Hey, currently I'm setting up a new Laravel application with Zitadel, Sail and Inertia for Authentication, so far so good. User is getting redirected properly towards Zitadel on clicking login, Zitadel is handling that and calling my configured callback route. But here something breaks on, probably, my side.

I'm using socialite and the zitadel provider. Inside the callback route I'm trying to get the user via $zitadelUser = Socialite::driver('zitadel')->user(); This line causes the application to just load endlessly and at some point eventually time out without any error message in the logs or what so ever.

Zitadel is configured as Application Type Web (as Inertia says that I can just use any Backend Authenticator the way I used to) and Response Types set to Code. to use "POST" as authentication with cliend_id and client_secret, both properly set on the application.

0 likes
2 replies
TheRabber's avatar

Quick update, it seems to be a communication issue between Zitadel and Laravel as I was able to recreate the request via Postman and this one worked

TheRabber's avatar

Ok, further investigation now:

  1. problem seems to be that I have laravel.localhost and zitadel.localhost configured via traefik, which causes my ZITADEL_BASE_URL to be http://zitadel.localhost, which is fine for the redirect but on the callback this zitadel.localhost is internally resolved inside the laravel container to their own localhost, which of course doesn't work in the end.

Please or to participate in this conversation.