File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4747 * Please refer to the hosted SP configuration reference for more information.
4848 */
4949 //'signature.algorithm' => 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256',
50+
51+ /*
52+ // The attributes parameter must contain an array of desired attributes by the SP.
53+ // The attributes can be expresed as an array of names or as an associative array
54+ // in the form of 'friendlyName' => 'name'.
55+ // The metadata will then be created as follows:
56+ // <md:RequestedAttribute FriendlyName="friendlyName" Name="name" />
57+ 'attributes' => array(
58+ 'attrname' => 'urn:oid:x.x.x.x',
59+ ),
60+ 'attributes.required' => array (
61+ 'urn:oid:x.x.x.x',
62+ ),
63+ */
5064 ),
5165
5266
Original file line number Diff line number Diff line change @@ -370,9 +370,12 @@ private function addAttributeConsumingService(SAML2_XML_md_SPSSODescriptor $spDe
370370 $ attributeconsumer ->ServiceDescription = $ metadata ->getLocalizedString ('description ' , array ());
371371
372372 $ nameFormat = $ metadata ->getString ('attributes.NameFormat ' , SAML2_Const::NAMEFORMAT_UNSPECIFIED );
373- foreach ($ attributes as $ attribute ) {
373+ foreach ($ attributes as $ friendlyName => $ attribute ) {
374374 $ t = new SAML2_XML_md_RequestedAttribute ();
375375 $ t ->Name = $ attribute ;
376+ if (!is_int ($ friendlyName )) {
377+ $ t ->FriendlyName = $ friendlyName ;
378+ }
376379 if ($ nameFormat !== SAML2_Const::NAMEFORMAT_UNSPECIFIED ) {
377380 $ t ->NameFormat = $ nameFormat ;
378381 }
Original file line number Diff line number Diff line change 124124}
125125
126126$ name = $ spconfig ->getLocalizedString ('name ' , NULL );
127- $ attributes = $ spconfig ->getArray ('attributes ' , array ());
127+ $ attributes = array_values ( $ spconfig ->getArray ('attributes ' , array () ));
128128
129129if ($ name !== NULL && !empty ($ attributes )) {
130130 $ metaArray20 ['name ' ] = $ name ;
You can’t perform that action at this time.
0 commit comments