Skip to content

Commit

Permalink
Supress warning on absent NameIDFormat
Browse files Browse the repository at this point in the history
After updating to 1.17 I started noticing a lot of warnings in the log:
\Mar  4 12:47:16 sv1810934 IDP-BZK[5791]: 3 [c11b0ed290] Unable to generate NameID. Check the userid.attribute option.

SP doesn't ask for a specific NameIDFormat and none is set in the metadata...
current([]) would return false, but we never catch that case,..
  • Loading branch information
tvdijen committed Mar 4, 2019
1 parent 0da4950 commit 1f1ba1e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/saml/lib/IdP/SAML2.php
Expand Up @@ -1206,6 +1206,9 @@ private static function buildAssertion(
$nameIdFormat = current($spMetadata->getArrayizeString('NameIDFormat', []));
if ($nameIdFormat === null) {
$nameIdFormat = current($idpMetadata->getArrayizeString('NameIDFormat', [\SAML2\Constants::NAMEID_TRANSIENT]));
} elseif ($nameIdFormat === false) {
// Not set in request or in metadata. Fall back to transient
$nameIdFormat = \SAML2\Constants::NAMEID_TRANSIENT;
}
}

Expand Down

0 comments on commit 1f1ba1e

Please sign in to comment.