Skip to content
Snippets Groups Projects
Commit bc620d4a authored by Olav Morken's avatar Olav Morken
Browse files

SimpleSAML_XML_Shib13_AuthnResponse: Remove configuration and metadata parameters.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1688 44740490-163a-0410-bde0-09ae8108e29a
parent 449ec1c2
No related branches found
No related tags found
No related merge requests found
......@@ -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)) {
......
......@@ -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) ) {
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment