From 768ed84e2931658a829f0cc97fbd0844bdfd3a87 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaime=20Pe=CC=81rez?= <jaime.perez@uninett.no>
Date: Mon, 7 Nov 2016 16:24:12 +0100
Subject: [PATCH] Support SAML2\XML\saml\NameID objects as the value of an
 eduPersonTargetedID.

---
 modules/saml/lib/IdP/SAML2.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/saml/lib/IdP/SAML2.php b/modules/saml/lib/IdP/SAML2.php
index 15f584d7e..8fbf2355a 100644
--- a/modules/saml/lib/IdP/SAML2.php
+++ b/modules/saml/lib/IdP/SAML2.php
@@ -718,7 +718,7 @@ class sspmod_saml_IdP_SAML2 {
 						$doc = \SAML2\DOMDocumentFactory::fromString('<root>' . $value . '</root>');
 						$value = $doc->firstChild->childNodes;
 					}
-					assert('$value instanceof DOMNodeList');
+					assert('$value instanceof DOMNodeList || $value instanceof \SAML2\XML\saml\NameID');
 					break;
 				default:
 					throw new SimpleSAML_Error_Exception('Invalid encoding for attribute ' .
-- 
GitLab