Error 109 Attributi senza NameFormat sebbene valorizzato

Nel report di validazione otteniamo Errore sul controllo 109.

Nel metadata come da specifiche SPID utilizziamo https://github.com/italia/spid-php che aggiunge agli attributi il NameFormat=“urn:oasis:names:tc:SAML:2.0:attrname-format:basic”

Di seguito la funzione parseAttribute del file Assertion.php di SAML2 che viene invocato dal validatore per il caso 109:

**
* Parse attribute statements in assertion.
*
* @param \DOMElement $xml The XML element with the assertion.
* @throws \Exception
*/
private function parseAttributes(\DOMElement $xml)
{
$firstAttribute = true;
$attributes = Utils::xpQuery($xml, ‘./saml_assertion:AttributeStatement/saml_assertion:Attribute’);
foreach ($attributes as $attribute) {
if (!$attribute->hasAttribute(‘Name’)) {
throw new \Exception(‘Missing name on saml:Attribute element.’);
}
$name = $attribute->getAttribute(‘Name’);

        if ($attribute->hasAttribute('NameFormat')) {
            $nameFormat = $attribute->getAttribute('NameFormat');
        } else {
            $nameFormat = Constants::NAMEFORMAT_UNSPECIFIED;
        }

        if ($firstAttribute) {
            $this->nameFormat = $nameFormat;
            $firstAttribute = false;
        } else {
            if ($this->nameFormat !== $nameFormat) {
                $this->nameFormat = Constants::NAMEFORMAT_UNSPECIFIED;
            }
        }

        if (!array_key_exists($name, $this->attributes)) {
            $this->attributes[$name] = array();
            $this->attributesValueTypes[$name] = array();
        }

        $this->parseAttributeValue($attribute, $name);
    }
}

**

Come dobbiamo modificare questa funzione? Calcolando che se non viene trovato il nameFormat , viene valorizzato come ‘urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified’.

Potete darci qualche input in merito?
Grazie

Buongiorno @factory20,
il test #109 verifica il caso in cui l’IdP invia una Response con gli elementi relativi agli attributi SPID restituiti, mancanti dell’attributo NameFormat.
In tal caso il SP non deve bloccare la response ma consentire comunque l’accesso.
Non occorre pertanto modificare il metadata del SP ma garantire che all’invio del test #109 il SP permetta l’accesso.

Michele D’Amico