From f38524004316ef5f2cbc7c7a498d4024b04ddafb Mon Sep 17 00:00:00 2001 From: shingo78 Date: Mon, 14 Mar 2022 21:51:15 +0900 Subject: [PATCH 1/3] Fix TypeError: SAML2\Message::setIssuer() --- composer.json | 2 +- lib/Auth/Process/attributeaggregator.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index cf99f0f..da83bb5 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "type": "simplesamlphp-module", "require": { "simplesamlphp/composer-module-installer": "~1.1", - "simplesamlphp/saml2": ">=3.0", + "simplesamlphp/saml2": ">=4.0", "ext-soap": "*" }, "require-dev": { diff --git a/lib/Auth/Process/attributeaggregator.php b/lib/Auth/Process/attributeaggregator.php index a5e0b4c..594d727 100644 --- a/lib/Auth/Process/attributeaggregator.php +++ b/lib/Auth/Process/attributeaggregator.php @@ -213,7 +213,9 @@ public function process(&$state) // build attribute query $query = new \SAML2\AttributeQuery(); $query->setDestination($this->aaEndpoint); - $query->setIssuer($this->selfMetadata->getValue('entityID')); + $issuer = new \SAML2\XML\saml\Issuer(); + $issuer->setValue($this->selfMetadata->getValue('entityID')); + $query->setIssuer($issuer); $nameid = \SAML2\XML\saml\NameID::fromArray ( array( 'Value' => $state['Attributes'][$this->attributeId][0], From ba3e0dbc4013effe3e8b778c8989d0a0de1113aa Mon Sep 17 00:00:00 2001 From: shingo78 Date: Mon, 14 Mar 2022 22:14:40 +0900 Subject: [PATCH 2/3] Fix undefined method NameID::fromArray() --- lib/Auth/Process/attributeaggregator.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/Auth/Process/attributeaggregator.php b/lib/Auth/Process/attributeaggregator.php index 594d727..cfa668f 100644 --- a/lib/Auth/Process/attributeaggregator.php +++ b/lib/Auth/Process/attributeaggregator.php @@ -216,12 +216,9 @@ public function process(&$state) $issuer = new \SAML2\XML\saml\Issuer(); $issuer->setValue($this->selfMetadata->getValue('entityID')); $query->setIssuer($issuer); - $nameid = \SAML2\XML\saml\NameID::fromArray ( - array( - 'Value' => $state['Attributes'][$this->attributeId][0], - 'Format' => $this->nameIdFormat, - ) - ); + $nameid = new \SAML2\XML\saml\NameID(); + $nameid->setValue($state['Attributes'][$this->attributeId][0]); + $nameid->setFormat($this->nameIdFormat); $query->setNameId($nameid); $query->setAttributeNameFormat($this->attributeNameFormat); $query->setAttributes($this->getRequestedAttributes()); // may be empty, then it's a noop From ae38a687c3c952c707d9048c2b5701796435ee6d Mon Sep 17 00:00:00 2001 From: shingo78 Date: Tue, 15 Mar 2022 11:37:48 +0900 Subject: [PATCH 3/3] Add version restriction for saml2 library workaround for saml2 library issue --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index da83bb5..d190233 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "type": "simplesamlphp-module", "require": { "simplesamlphp/composer-module-installer": "~1.1", - "simplesamlphp/saml2": ">=4.0", + "simplesamlphp/saml2": ">=4.0, <4.2.8", "ext-soap": "*" }, "require-dev": {