Skip to content
Snippets Groups Projects
Commit 1ad2fd28 authored by Jaime Perez's avatar Jaime Perez
Browse files

Merge branch 'biancini-master'

parents 1431fc47 2809ed74
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,20 @@ $config = array(
* Please refer to the hosted SP configuration reference for more information.
*/
//'signature.algorithm' => 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256',
/*
// The attributes parameter must contain an array of desired attributes by the SP.
// The attributes can be expresed as an array of names or as an associative array
// in the form of 'friendlyName' => 'name'.
// The metadata will then be created as follows:
// <md:RequestedAttribute FriendlyName="friendlyName" Name="name" />
'attributes' => array(
'attrname' => 'urn:oid:x.x.x.x',
),
'attributes.required' => array (
'urn:oid:x.x.x.x',
),
*/
),
......
......@@ -370,9 +370,12 @@ class SimpleSAML_Metadata_SAMLBuilder {
$attributeconsumer->ServiceDescription = $metadata->getLocalizedString('description', array());
$nameFormat = $metadata->getString('attributes.NameFormat', SAML2_Const::NAMEFORMAT_UNSPECIFIED);
foreach ($attributes as $attribute) {
foreach ($attributes as $friendlyName => $attribute) {
$t = new SAML2_XML_md_RequestedAttribute();
$t->Name = $attribute;
if (!is_int($friendlyName)) {
$t->FriendlyName = $friendlyName;
}
if ($nameFormat !== SAML2_Const::NAMEFORMAT_UNSPECIFIED) {
$t->NameFormat = $nameFormat;
}
......
......@@ -124,7 +124,7 @@ if ($format !== NULL) {
}
$name = $spconfig->getLocalizedString('name', NULL);
$attributes = $spconfig->getArray('attributes', array());
$attributes = array_values($spconfig->getArray('attributes', array()));
if ($name !== NULL && !empty($attributes)) {
$metaArray20['name'] = $name;
......
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