Merge pull request #647 from nextcloud/fix/630/default-idp-value

fix signining in with IdPs other than 1
This commit is contained in:
Vincent Petry 2022-08-25 17:03:49 +02:00 committed by GitHub
commit 1bb98b4e00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 11 deletions

View file

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

View file

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