fix signining in with IdPs other than 1

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2022-08-24 14:32:57 +02:00
parent c058e1736d
commit fae25fa4ab
No known key found for this signature in database
GPG key ID: 7424F1874854DF23
2 changed files with 2 additions and 11 deletions

View file

@ -27,9 +27,6 @@ return [
'name' => 'SAML#login', 'name' => 'SAML#login',
'url' => '/saml/login', 'url' => '/saml/login',
'verb' => 'GET', 'verb' => 'GET',
'defaults' => [
'idp' => 1
],
], ],
[ [
'name' => 'SAML#base', 'name' => 'SAML#base',
@ -40,17 +37,11 @@ return [
'name' => 'SAML#getMetadata', 'name' => 'SAML#getMetadata',
'url' => '/saml/metadata', 'url' => '/saml/metadata',
'verb' => 'GET', 'verb' => 'GET',
'defaults' => [
'idp' => 1
],
], ],
[ [
'name' => 'SAML#assertionConsumerService', 'name' => 'SAML#assertionConsumerService',
'url' => '/saml/acs', 'url' => '/saml/acs',
'verb' => 'POST', 'verb' => 'POST',
'defaults' => [
'idp' => 1
],
], ],
[ [
'name' => 'SAML#singleLogoutService', 'name' => 'SAML#singleLogoutService',

View file

@ -167,7 +167,7 @@ class SAMLController extends Controller {
* @return Http\RedirectResponse * @return Http\RedirectResponse
* @throws \Exception * @throws \Exception
*/ */
public function login($idp) { public function login(int $idp = 1) {
$type = $this->config->getAppValue($this->appName, 'type'); $type = $this->config->getAppValue($this->appName, 'type');
switch ($type) { switch ($type) {
case 'saml': case 'saml':
@ -242,7 +242,7 @@ class SAMLController extends Controller {
* @return Http\DataDownloadResponse * @return Http\DataDownloadResponse
* @throws Error * @throws Error
*/ */
public function getMetadata($idp) { public function getMetadata(int $idp = 1) {
$settings = new Settings($this->samlSettings->getOneLoginSettingsArray($idp)); $settings = new Settings($this->samlSettings->getOneLoginSettingsArray($idp));
$metadata = $settings->getSPMetadata(); $metadata = $settings->getSPMetadata();
$errors = $settings->validateMetadata($metadata); $errors = $settings->validateMetadata($metadata);