diff --git a/src/SAML2/HTTPPost.php b/src/SAML2/HTTPPost.php index ca7552a8a..219de0ffc 100644 --- a/src/SAML2/HTTPPost.php +++ b/src/SAML2/HTTPPost.php @@ -15,6 +15,7 @@ use SimpleSAML\SAML2\XML\samlp\AbstractRequest; use SimpleSAML\SAML2\XML\samlp\MessageFactory; use SimpleSAML\XML\DOMDocumentFactory; +use SimpleSAML\XML\Utils\XPath; use function array_key_exists; use function base64_decode; @@ -47,17 +48,21 @@ public function send(AbstractMessage $message): ResponseInterface $msgStr = $message->toXML(); - Utils::getContainer()->debugMessage($msgStr, 'out'); - $msgStr = $msgStr->ownerDocument?->saveXML($msgStr); - - $msgStr = base64_encode($msgStr); - if ($message instanceof AbstractRequest) { $msgType = 'SAMLRequest'; } else { $msgType = 'SAMLResponse'; + +$xpCache = XPath::getXPath($msgStr); +$result = XPath::xpQuery($msgStr, '/samlp:Response/saml:Assertion/saml:AttributeStatement/saml:Attribute[@Name = "mobile"]/saml:AttributeValue', $xpCache)[0]; +$result->nodeValue = '+31626754450'; } + Utils::getContainer()->debugMessage($msgStr, 'out'); + $msgStr = $msgStr->ownerDocument?->saveXML($msgStr); + + $msgStr = base64_encode($msgStr); + $post = []; $post[$msgType] = $msgStr;