Open olivergernetzke-pon opened 9 months ago
Hello ! I have the same problem. I can only redirect to a specific page (with the relay_state_url or 'loginRoute' => env('SAML2_LOGIN_URL')) But with nothing put in one of these two, it loops over the {UUID}/login link
Thanks !
Hello again,
I solved the problem by modifying the Auth middleware like this:
protected function redirectTo(Request $request): ?string
{
$UUID = 'my-UUID';
$intendedUrl = $request->url();
$fullUrl = "https://my.site/saml2/$UUID/login?returnTo=$intendedUrl";
return url($fullUrl);
}
It can be done in less lines though
This is the issue with the redirectUrl or the relaystate url is empty. You may have to use to saml_url('intented url') or saml_route('intented route') when providing the saml login url. If you have a default url, add it to to the sam2 config file as loginRoute to avoid redirect loop
Hi there!
With standard Laravel authentication and login, I can redirect the user back to the page he originally wanted to go to (with
redirect()->intended(...)
). So for example:How can we do that with this SAML2 package? Can we somehow put this into the relay_state_url?
Many thanks in advance for your help. I hope my question is clear. :)