eXist-db / existdb-saml

XQuery module that implements SAML v2 single sign-on
GNU Lesser General Public License v2.1
4 stars 3 forks source link

Fix to correctly extract the SAML Response #29

Closed adamretter closed 1 year ago

adamretter commented 1 year ago

The SAML response is extracted from the HTTP Request Body via fn:parse-xml-fragment#1. The existing XQuery code was expecting fn:parse-xml-fragment($resp) to return a value of type element(samlp:Response), however that is incorrect in theory, and also does not work in practice (tested on eXist-db 6.x.x and 7.x.x). The W3 spec for the XQuery function fn:parse-xml-fragment#1 specifies that a value of type document-node(element(samlp:Response)) will be returned. This PR fixes that bug.