@@ -51,7 +51,7 @@ public function process(&$request)
5151 } else {
5252 throw new SimpleSAML_Error_Exception ("perun:PerunAttributes: " .
5353 "missing mandatory field 'perun.user' in request. " .
54- "Hint: Did you configured PerunIdentity filter before this filter? "
54+ "Hint: Have you configured PerunIdentity filter before this filter? "
5555 );
5656 }
5757
@@ -63,6 +63,7 @@ public function process(&$request)
6363
6464 $ sspAttr = $ this ->attrMap [$ attrName ];
6565
66+ // convert $attrValue into array
6667 if (is_null ($ attrValue )) {
6768 $ value = array ();
6869 } else if (is_string ($ attrValue )) {
@@ -76,10 +77,24 @@ public function process(&$request)
7677 "Attribute name: $ attrName, Supported types: null, string, array, associative array. " );
7778 }
7879
80+ // convert $sspAttr into array
81+ if (is_string ($ sspAttr )) {
82+ $ attrArray = array ($ sspAttr );
83+ } else if (is_array ($ sspAttr )) {
84+ $ attrArray = $ sspAttr ;
85+ } else {
86+ throw new SimpleSAML_Error_Exception ("sspmod_perun_Auth_Process_PerunAttributes - Unsupported attribute type. " .
87+ "Attribute \$attrName, Supported types: string, array. " );
88+ }
89+
7990 SimpleSAML \Logger::debug ("perun:PerunAttributes: perun attribute $ attrName was fetched. " .
80- "Value " .implode (", " , $ value )." is being setted to ssp attribute $ sspAttr " );
91+ "Value " . implode (", " , $ value ) . " is being set to ssp attribute " . implode (", " , $ attrArray ));
92+
93+ // write $value to all SP attributes
94+ foreach ($ attrArray as $ attribute ) {
95+ $ request ['Attributes ' ][$ attribute ] = $ value ;
96+ }
8197
82- $ request ['Attributes ' ][$ sspAttr ] = $ value ;
8398 }
8499
85100 }
0 commit comments