Receiving multi-value attributes
The Agent Toolkit for PHP receives multi-value attributes passed in the SAML assertion from PingFederate using the MultiStringArray PHP class distributed with the Agent Toolkit for PHP.
The following code snippet demonstrates how to get the multi-value attributes using the Agent Toolkit for PHP:
<?php # Use and instantiate an agent use pingidentity\opentoken\agent; use pingidentity\opentoken\helpers\multistringarray; $myagent = new Agent(); # read OpenToken into a MultiStringArray ($userInfo) $userInfo = $myagent->readTokenFromHttpRequestToMultiStringArray(); # retrieve single value attribute $username = $userinfo->get(TOKEN_SUBJECT, 0); # retrieve multiple value attribute. Returns an array of values. $multiValues = $userinfo->get(“MultiValueAttr”); ?>