OTA-Insight / djangosaml2idp

SAML 2.0 Identity Provider in Django
Apache License 2.0
104 stars 96 forks source link

Fix error when writting XML metadata with utf-8 characters #148

Open vgiralt opened 1 year ago

vgiralt commented 1 year ago

If SP metadata contains utf-8 characters, for example letters with diacriticals, the generation of the corresponding XML file on the filesystem, fails with an error, resulting in interrupted SAML flow and, thus, blocking authentication (at least in the relatively dated systems I'm forced to use). Properly formatted Metadata XML SHOULD be utf-8, so, adding the encoding parameter to the open statement, fixes the problem.