diff options
author | blizzz <blizzz@arthur-schiwon.de> | 2022-04-11 13:24:45 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-11 13:24:45 +0300 |
commit | 8cc470e182abaca2103400309a83d34dd266dcdc (patch) | |
tree | e04bcfa5a03846c0788d15444460d36754621480 /lib | |
parent | 18fa8a11f28f1363e6acab5cde8b5c695a56d2d9 (diff) | |
parent | b91b85f417bff778345e6e1bd05f7a01434b5399 (diff) |
Merge pull request #588 from nextcloud/bugfix/noid/relaystate
Set proper relaystate url
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Controller/SAMLController.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Controller/SAMLController.php b/lib/Controller/SAMLController.php index 4f354307..14f19967 100644 --- a/lib/Controller/SAMLController.php +++ b/lib/Controller/SAMLController.php @@ -172,7 +172,8 @@ class SAMLController extends Controller { switch ($type) { case 'saml': $auth = new Auth($this->samlSettings->getOneLoginSettingsArray($idp)); - $ssoUrl = $auth->login(null, [], false, false, true); + $returnUrl = $this->request->getParam('originalUrl', $this->urlGenerator->linkToRouteAbsolute('user_saml.SAML.login')); + $ssoUrl = $auth->login($returnUrl, [], false, false, true); $response = new Http\RedirectResponse($ssoUrl); // Small hack to make user_saml work with the loginflows @@ -359,7 +360,7 @@ class SAMLController extends Controller { return $response; } - $originalUrl = $data['OriginalUrl']; + $originalUrl = $data['RelayState'] ?? $data['OriginalUrl']; if ($originalUrl !== null && $originalUrl !== '') { $response = new Http\RedirectResponse($originalUrl); } else { |