Skip to content

Commit

Permalink
Merge b2474de into a7d443b
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Mar 7, 2019
2 parents a7d443b + b2474de commit fd7689f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/saml/lib/IdP/SAML2.php
Expand Up @@ -1194,17 +1194,17 @@ private static function buildAssertion(
$a->setAttributes($attributes);
}

$nameIdFormat = null;

// generate the NameID for the assertion
if (isset($state['saml:NameIDFormat'])) {
$nameIdFormat = $state['saml:NameIDFormat'];
} else {
$nameIdFormat = null;
}

if ($nameIdFormat === null || !isset($state['saml:NameID'][$nameIdFormat])) {
// either not set in request, or not set to a format we supply. Fall back to old generation method
$nameIdFormat = current($spMetadata->getArrayizeString('NameIDFormat', []));
if ($nameIdFormat === null) {
if ($nameIdFormat === false) {
$nameIdFormat = current($idpMetadata->getArrayizeString('NameIDFormat', [\SAML2\Constants::NAMEID_TRANSIENT]));
}
}
Expand Down

0 comments on commit fd7689f

Please sign in to comment.