auth0 / passport-wsfed-saml2

passport strategy for both WS-fed and SAML2 protocol

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SAML XML is always parsed assuming utf-8 encoding.

ziluvatar opened this issue · comments

While reading the SAMLResponse the library converts the base64 string to a Buffer, after that it converts whether to a string without considering if the XML defined a different encoding in the prolog:

<?xml version="1.0" encoding="UTF-8" ?> <== usually UTF-8 is used, in some cases it can contain a different encoding. We should read the rest of XML based on that encoding.

commented

Hi, original ticket poster here.

If this proves to be a problem wrt runtime detection (or an implementation would be lengthy), I think we could get by (in this specific case) if we could set the encoding on the connection configuration (assuming implementing that would be quicker than the runtime detection).

I have just received confirmation from the mainframe team that the host always sends ISO-8859-1, so we can 'hard-configure' in this case.

HTH?