Skip to content
Snippets Groups Projects
Commit 8fcaa27a authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg
Browse files

Adding support for multivalued attributes in the Shib 1.3 IdP

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@217 44740490-163a-0410-bde0-09ae8108e29a
parent b8285828
No related branches found
No related tags found
No related merge requests found
......@@ -311,7 +311,7 @@ class SimpleSAML_XML_Shib13_AuthnResponse extends SimpleSAML_XML_AuthnResponse {
</Subject>';
foreach ($attributes AS $name => $value) {
$encodedattributes .= $this->enc_attribute($name, $value[0], $base64);
$encodedattributes .= $this->enc_attribute($name, $value, $base64);
}
$encodedattributes .= '</AttributeStatement>';
......@@ -364,11 +364,14 @@ class SimpleSAML_XML_Shib13_AuthnResponse extends SimpleSAML_XML_AuthnResponse {
private function enc_attribute($name, $value, $base64 = false) {
return '<Attribute AttributeName="' . htmlspecialchars($name) . '"
AttributeNamespace="urn:mace:shibboleth:1.0:attributeNamespace:uri">
<AttributeValue>' . ($base64 ? base64_encode($value) : htmlspecialchars($value) ) . '</AttributeValue>
</Attribute>';
private function enc_attribute($name, $values, $base64 = false) {
$attr = '<Attribute AttributeName="' . htmlspecialchars($name) . '" AttributeNamespace="urn:mace:shibboleth:1.0:attributeNamespace:uri">';
foreach ($values AS $value) {
$attr .= '<AttributeValue>' . ($base64 ? base64_encode($value) : htmlspecialchars($value) ) . '</AttributeValue>';
}
$attr .= '</Attribute>';
return $attr;
}
}
......
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