I am trying to compare strings but I always get false. I tried to use var_dump on both values but they are 2 different lengths. I have seen this question has been asked many times but not sure how to resolve this.
$nameid = $as->getAuthData('saml:sp:NameID');
$luser = $nameid;
$loguser = strtolower($luser);
var_dump($loguser);
// this returns string(167) "test1.test@comtest.com"
$arr = array('test1.test@comtest.com', 'test2.test@comtest.com');
foreach ($arr as $value)
{
var_dump($value);
//this returns string(28) "test1.test@comtest.com"
if ($test == $value)
{
echo('success');
break;
}
}
I see this following markup in the View Source: I am not sure how do to get this value from this XML.
<saml:nameid xmlns:saml="urn:oasis:names:tc:saml:2.0:assertion" format="urn:oasis:names:tc:saml:2.0:nameid-format:transient">test1.test@comtest.com</saml:nameid>