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

saml2_Message: Allow base64attributes and attributeencodigns to be specified...

saml2_Message: Allow base64attributes and attributeencodigns to be specified on both src metadata and dst metadata.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1685 44740490-163a-0410-bde0-09ae8108e29a
parent 3d774897
No related branches found
No related tags found
No related merge requests found
......@@ -448,14 +448,25 @@ class sspmod_saml2_Message {
private static function encodeAttributes(SimpleSAML_Configuration $srcMetadata,
SimpleSAML_Configuration $dstMetadata, array $attributes) {
$base64Attributes = $dstMetadata->getBoolean('base64attributes', FALSE);
$base64Attributes = $dstMetadata->getBoolean('base64attributes', NULL);
if ($base64Attributes === NULL) {
$base64Attributes = $srcMetadata->getBoolean('base64attributes', FALSE);
}
if ($base64Attributes) {
$defaultEncoding = 'base64';
} else {
$defaultEncoding = 'string';
}
$encodings = $dstMetadata->getArray('attributeencodings', array());
$srcEncodings = $srcMetadata->getArray('attributeencodings', array());
$dstEncodings = $dstMetadata->getArray('attributeencodings', array());
/*
* Merge the two encoding arrays. Encodings specified in the target metadata
* takes precedence over the source metadata.
*/
$encodings = array_merge($srcEncodings, $dstEncodings);
$ret = array();
foreach ($attributes as $name => $values) {
......
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