Open happenpappen opened 1 year ago
Run this command:
php artisan make:listener SsoLoginListener --event=\Slides\Saml2\Events\SignedIn
This will create a new Listener class under the app\Listeners dir.
Auth::login here doesn't work!
@mohamed-salah-tawfik The same thing happened to me. I could login the user in the listener but once they were redirected to the app, they were not logged in.
Check you have routesMiddleware set in your config/saml2.php file. Mine is set to 'web'. You need to make sure the middleware group is using StartSession in Kernel.php (the 'web' middleware group will do this by default).
@mohamed-salah-tawfik The same thing happened to me. I could login the user in the listener but once they were redirected to the app, they were not logged in.
Check you have routesMiddleware set in your config/saml2.php file. Mine is set to 'web'. You need to make sure the middleware group is using StartSession in Kernel.php (the 'web' middleware group will do this by default).
Thank you so much. This really helped a lot. To anyone who experiences 419 error, you need to edit your VerifyCsrfToken Middleware.
I clear up some things for users running laravel 11 or higher:
'routesMiddleware' => ['web']
in saml2.phpbootstrap/app.php
within the withMiddleware
closure:$middleware->validateCsrfTokens(except: ['saml2/*']);
Hi,
the readme says under "Authentication events", that you should "add listeners on Slides\Saml2\SignedIn and Slides\Saml2\SignedOut events.", but it does not tell where (in which file) one should do that - is there any example showing exactly what to do?
kind regards,
Christoph