From 994198f4c9e6a9eb6b209465ec5b324b4c10ae80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Pe=CC=81rez=20Crespo?= <jaime.perez@uninett.no> Date: Wed, 15 Apr 2020 15:27:18 +0200 Subject: [PATCH] Use the ID of the default auth source, not "default" This makes it possible for existing deployments to have this working with SSO. Otherwise, the user would end up authenticated with the "default" auth source when accessing the web interface, and "another" auth source when logging in via SAML. --- modules/core/lib/Controller/Login.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/core/lib/Controller/Login.php b/modules/core/lib/Controller/Login.php index 32c6b01c5..e555b1c66 100644 --- a/modules/core/lib/Controller/Login.php +++ b/modules/core/lib/Controller/Login.php @@ -144,8 +144,18 @@ class Login $t->data['sources'] = $this->sources; return $t; } + // we have a default, use that one $as = 'default'; + foreach ($this->sources as $id => $source) { + if ($id === 'default') { + continue; + } + if ($source === $this->sources['default']) { + $as = $id; + break; + } + } } // auth source defined, check if valid -- GitLab