diff --git a/lib/SimpleSAML/Bindings/Shib13/HTTPPost.php b/lib/SimpleSAML/Bindings/Shib13/HTTPPost.php index c4554749c9940d072676a5482b5cd62629bbde2d..f776889dadfe3c954d38856b5b059a26a84cd744 100644 --- a/lib/SimpleSAML/Bindings/Shib13/HTTPPost.php +++ b/lib/SimpleSAML/Bindings/Shib13/HTTPPost.php @@ -120,7 +120,7 @@ class SimpleSAML_Bindings_Shib13_HTTPPost { SimpleSAML_Utilities::validateXMLDocument($samlResponseXML, 'saml11'); - $samlResponse = new SimpleSAML_XML_Shib13_AuthnResponse($this->configuration, $this->metadata); + $samlResponse = new SimpleSAML_XML_Shib13_AuthnResponse(); $samlResponse->setXML($samlResponseXML); if (array_key_exists('TARGET', $post)) { diff --git a/lib/SimpleSAML/XML/Shib13/AuthnResponse.php b/lib/SimpleSAML/XML/Shib13/AuthnResponse.php index e1b7c564fa9d505177902e44eee25d2e81fc42b3..f3b6bb1671d69f0339eb8608ebc740df92f859b8 100644 --- a/lib/SimpleSAML/XML/Shib13/AuthnResponse.php +++ b/lib/SimpleSAML/XML/Shib13/AuthnResponse.php @@ -18,9 +18,7 @@ class SimpleSAML_XML_Shib13_AuthnResponse extends SimpleSAML_XML_AuthnResponse { const SHIB_PROTOCOL_NS = 'urn:oasis:names:tc:SAML:1.0:protocol'; const SHIB_ASSERT_NS = 'urn:oasis:names:tc:SAML:1.0:assertion'; - function __construct(SimpleSAML_Configuration $configuration, SimpleSAML_Metadata_MetaDataStorageHandler $metadatastore) { - $this->configuration = $configuration; - $this->metadata = $metadatastore; + function __construct() { } // Inhereted public function setXML($xml) { @@ -40,7 +38,8 @@ class SimpleSAML_XML_Shib13_AuthnResponse extends SimpleSAML_XML_AuthnResponse { $issuer = $this->getIssuer(); /* Get the metadata of the issuer. */ - $md = $this->metadata->getMetaData($issuer, 'shib13-idp-remote'); + $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); + $md = $metadata->getMetaData($issuer, 'shib13-idp-remote'); if(array_key_exists('certFingerprint', $md)) { /* Get fingerprint for the certificate of the issuer. */ @@ -50,7 +49,8 @@ class SimpleSAML_XML_Shib13_AuthnResponse extends SimpleSAML_XML_AuthnResponse { $this->validator->validateFingerprint($issuerFingerprint); } elseif(array_key_exists('caFile', $md)) { /* Validate against CA. */ - $this->validator->validateCA($this->configuration->getPathValue('certdir', 'cert/') . $md['caFile']); + $globalConfig = SimpleSAML_Configuration::getInstance(); + $this->validator->validateCA($globalConfig->getPathValue('certdir', 'cert/') . $md['caFile']); } else { throw new Exception('Required field [certFingerprint] or [caFile] in Shibboleth 1.3 IdP Remote metadata was not found for identity provider [' . $issuer . ']. Please add a fingerprint and try again. You can add a dummy fingerprint first, and then an error message will be printed with the real fingerprint.'); } @@ -130,7 +130,8 @@ class SimpleSAML_XML_Shib13_AuthnResponse extends SimpleSAML_XML_AuthnResponse { public function getAttributes() { - $md = $this->metadata->getMetadata($this->getIssuer(), 'shib13-idp-remote'); + $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); + $md = $metadata->getMetadata($this->getIssuer(), 'shib13-idp-remote'); $base64 = isset($md['base64attributes']) ? $md['base64attributes'] : false; if (! ($this->getDOM() instanceof DOMDocument) ) { diff --git a/www/shib13/idp/SSOService.php b/www/shib13/idp/SSOService.php index ce2b6bba4654040700a652dbb12e90f6ee63cacc..ce3267772e368665d33b629df09d312f3b842082 100644 --- a/www/shib13/idp/SSOService.php +++ b/www/shib13/idp/SSOService.php @@ -202,7 +202,7 @@ try { $attributes = $authProcState['Attributes']; /* Generate and send response. */ - $ar = new SimpleSAML_XML_Shib13_AuthnResponse($config, $metadata); + $ar = new SimpleSAML_XML_Shib13_AuthnResponse(); $authnResponseXML = $ar->generate($idpmetadata, $spmetadata, $shire, $attributes); $httppost = new SimpleSAML_Bindings_Shib13_HTTPPost($config, $metadata);