Skip to content
Snippets Groups Projects
Commit ae89ba10 authored by Thijs Kinkhorst's avatar Thijs Kinkhorst
Browse files

Merge branch 'vanhanit-master't push origin master

parents 1a4166f8 700c65d9
No related branches found
No related tags found
No related merge requests found
......@@ -402,7 +402,11 @@ class SimpleSAML_Metadata_SAMLBuilder
*/
$attributeconsumer = new \SAML2\XML\md\AttributeConsumingService();
$attributeconsumer->index = 0;
$attributeconsumer->index = $metadata->getInteger('attributes.index', 0);
if ($metadata->hasValue('attributes.isDefault')) {
$attributeconsumer->isDefault = $metadata->getBoolean('attributes.isDefault', false);
}
$attributeconsumer->ServiceName = $name;
$attributeconsumer->ServiceDescription = $metadata->getLocalizedString('description', array());
......
......@@ -690,6 +690,12 @@ class SimpleSAML_Metadata_SAMLParser
if (array_key_exists('attributes.NameFormat', $spd)) {
$ret['attributes.NameFormat'] = $spd['attributes.NameFormat'];
}
if (array_key_exists('attributes.index', $spd)) {
$ret['attributes.index'] = $spd['attributes.index'];
}
if (array_key_exists('attributes.isDefault', $spd)) {
$ret['attributes.isDefault'] = $spd['attributes.isDefault'];
}
// add name & description
if (array_key_exists('name', $spd)) {
......
......@@ -125,6 +125,12 @@ Options
`attributes.NameFormat`
: The `NameFormat` for the requested attributes.
`attributes.index`
: The `index` attribute that is set in the md:AttributeConsumingService element. Integer value that defaults to `0`.
`attributes.isDefault`
: If present, sets the `isDefault` attribute in the md:AttributeConsumingService element. Boolean value that defaults to `false`.
`attributes.required`
: If you have attributes added you can here specify which should be marked as required.
: The attributes should still be present in `attributes`.
......
......@@ -164,6 +164,14 @@ if ($name !== null && !empty($attributes)) {
if ($nameFormat !== null) {
$metaArray20['attributes.NameFormat'] = $nameFormat;
}
if ($spconfig->hasValue('attributes.index')) {
$metaArray20['attributes.index'] = $spconfig->getInteger('attributes.index', 0);
}
if ($spconfig->hasValue('attributes.isDefault')) {
$metaArray20['attributes.isDefault'] = $spconfig->getBoolean('attributes.isDefault', false);
}
}
// add organization info
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment