diff --git a/src/SimpleSAML/Utils/Config/Metadata.php b/src/SimpleSAML/Utils/Config/Metadata.php index f7a1a389aaa29328fb81157b4a51a641a1f0ca0f..d47526213791eb83fdf44b6ab5ac338aa3338934 100644 --- a/src/SimpleSAML/Utils/Config/Metadata.php +++ b/src/SimpleSAML/Utils/Config/Metadata.php @@ -262,7 +262,7 @@ class Metadata /** * This method parses the different possible values of the NameIDPolicy metadata configuration. * - * @param mixed $nameIdPolicy + * @param null|array|false $nameIdPolicy * * @return null|array */ @@ -270,10 +270,7 @@ class Metadata { $policy = null; - if (is_string($nameIdPolicy)) { - // handle old configurations where 'NameIDPolicy' was used to specify just the format - $policy = ['Format' => $nameIdPolicy, 'AllowCreate' => true]; - } elseif (is_array($nameIdPolicy)) { + if (is_array($nameIdPolicy)) { // handle current configurations specifying an array in the NameIDPolicy config option $nameIdPolicy_cf = Configuration::loadFromArray($nameIdPolicy); $policy = [ diff --git a/tests/src/SimpleSAML/Utils/Config/MetadataTest.php b/tests/src/SimpleSAML/Utils/Config/MetadataTest.php index 8f38a7f2390dc7a5b53f0bbc0fd15df1c5d5af33..69f55762a05417f0c8146ada46da449bb6a435dc 100644 --- a/tests/src/SimpleSAML/Utils/Config/MetadataTest.php +++ b/tests/src/SimpleSAML/Utils/Config/MetadataTest.php @@ -236,13 +236,6 @@ class MetadataTest extends TestCase $nameIdPolicy = false; $this->assertEquals(null, Metadata::parseNameIdPolicy($nameIdPolicy)); - // Test string - $nameIdPolicy = 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress'; - $this->assertEquals( - ['Format' => 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress', 'AllowCreate' => true], - Metadata::parseNameIdPolicy($nameIdPolicy) - ); - // Test array $nameIdPolicy = [ 'Format' => 'urn:oasis:names:tc:SAML:1.1:nameid-format:persistent',