#Auth::login() in an event listener not working

3 messages · Page 1 of 1 (latest)

slim tundra
#

Whats up everyone, trying to setup a saml auth on my Laravel Inertia app. Everything seems okay but when it gets to the point of listening for a SignIn event, the listener does not seem to be able to log the user in. The data gets there the user is found, but he does not get authenticated.

The listener is defined manually in the AppServiceProvider.
Is the listener even executed on the same request as the user or in some other parallel way?

Im using:
Laravel 11.31
inertia-laravel 1.0
sanctum 4.0
24slides/laravel-saml2 2.4 - https://github.com/24Slides/laravel-saml2

Thank you for your time!

GitHub

[Laravel 5.4+] An integration to add SSO to your service via SAML2 protocol based on OneLogin toolkit with support of multiple Identity Providers - 24Slides/laravel-saml2

bright sun
#

If the auth works but doesn't persist it's usually a cookie issue. Verify your session cookie settings, try logging in from an incognito browser, and inspect the response headers. Does the session cookie's domain match the page's domain?