Skip to content
Snippets Groups Projects
Commit 131c640e authored by Tim van Dijen's avatar Tim van Dijen
Browse files

Remove deprecated string use-case for NameIDPolicy

parent 7194b689
No related branches found
No related tags found
No related merge requests found
......@@ -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 = [
......
......@@ -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',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment