Skip to content
Snippets Groups Projects
Unverified Commit a51b2ef0 authored by Thijs Kinkhorst's avatar Thijs Kinkhorst Committed by GitHub
Browse files

Merge pull request #1055 from simplesamlphp/tvdijen-patch-nameidformat

Supress warning on absent NameIDFormat
parents f983c419 b2474de4
No related branches found
No related tags found
No related merge requests found
...@@ -1194,17 +1194,17 @@ class SAML2 ...@@ -1194,17 +1194,17 @@ class SAML2
$a->setAttributes($attributes); $a->setAttributes($attributes);
} }
$nameIdFormat = null;
// generate the NameID for the assertion // generate the NameID for the assertion
if (isset($state['saml:NameIDFormat'])) { if (isset($state['saml:NameIDFormat'])) {
$nameIdFormat = $state['saml:NameIDFormat']; $nameIdFormat = $state['saml:NameIDFormat'];
} else {
$nameIdFormat = null;
} }
if ($nameIdFormat === null || !isset($state['saml:NameID'][$nameIdFormat])) { 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 // either not set in request, or not set to a format we supply. Fall back to old generation method
$nameIdFormat = current($spMetadata->getArrayizeString('NameIDFormat', [])); $nameIdFormat = current($spMetadata->getArrayizeString('NameIDFormat', []));
if ($nameIdFormat === null) { if ($nameIdFormat === false) {
$nameIdFormat = current($idpMetadata->getArrayizeString('NameIDFormat', [\SAML2\Constants::NAMEID_TRANSIENT])); $nameIdFormat = current($idpMetadata->getArrayizeString('NameIDFormat', [\SAML2\Constants::NAMEID_TRANSIENT]));
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment