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

SAMLBuilder: Support for adding AttributeAuthorityDescriptor.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1961 44740490-163a-0410-bde0-09ae8108e29a
parent b9ff7d4a
No related branches found
No related tags found
No related merge requests found
...@@ -283,6 +283,9 @@ class SimpleSAML_Metadata_SAMLBuilder { ...@@ -283,6 +283,9 @@ class SimpleSAML_Metadata_SAMLBuilder {
case 'shib13-idp-remote': case 'shib13-idp-remote':
$this->addMetadataIdP11($metadata); $this->addMetadataIdP11($metadata);
break; break;
case 'attributeauthority-remote':
$this->addAttributeAuthority($metadata);
break;
default: default:
SimpleSAML_Logger::warning('Unable to generate metadata for unknown type \'' . $set . '\'.'); SimpleSAML_Logger::warning('Unable to generate metadata for unknown type \'' . $set . '\'.');
} }
...@@ -488,6 +491,37 @@ class SimpleSAML_Metadata_SAMLBuilder { ...@@ -488,6 +491,37 @@ class SimpleSAML_Metadata_SAMLBuilder {
} }
/**
* Add a AttributeAuthorityDescriptor.
*
* @param array $metadata The AttributeAuthorityDescriptor, in the format returned by SAMLParser.
*/
public function addAttributeAuthority(array $metadata) {
assert('is_array($metadata)');
assert('isset($metadata["entityid"])');
assert('isset($metadata["metadata-set"])');
$metadata = SimpleSAML_Configuration::loadFromArray($metadata, $metadata['entityid']);
$e = $this->createElement('AttributeAuthorityDescriptor');
$e->setAttribute('protocolSupportEnumeration', implode(' ', $metadata->getArray('protocols', array())));
$this->addExtensions($metadata, $e);
$this->addCertificate($e, $metadata);
$this->addEndpoints($e, 'AttributeService', $metadata->getEndpoints('AttributeService'));
$this->addEndpoints($e, 'AssertionIDRequestService', $metadata->getEndpoints('AssertionIDRequestService'));
foreach ($metadata->getArray('NameIDFormat', array()) as $format) {
$t = $this->createElement('NameIDFormat');
$t->appendChild($this->document->createTextNode($format));
$e->appendChild($t);
}
$this->entityDescriptor->appendChild($e);
}
/** /**
* Add contact information. * Add contact information.
* *
......
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