Azure AD B2C integration failure - 'utf8' is not a supported encoding name
See original GitHub issueThe following exception is returned from Azure AD B2C when attempting to access a djangosaml2-generated metadata xml:
“Exception”: { “Kind”: “Handled”, “HResult”: “80131509”, “Message”: “The character set provided in ContentType is invalid. Cannot read content as string using an invalid character set.”, “Data”: {}, “Exception”: { “Kind”: “Handled”, “HResult”: “80070057”, “Message”: “‘utf8’ is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.\r\nParameter name: name”, “Data”: {} }
The exception is a result of how the charset is specified here: https://github.com/knaperek/djangosaml2/blob/a382e9e81d7f4a1a440a7b0130250f5c2b54c4b9/djangosaml2/views.py#L578
Given that utf8
is not a valid charset, I believe an appropriate solution here is to simply modify the specified charset to be utf-8
.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (8 by maintainers)
It’s patched in RC so It’s in the future stable release
Yes, feel free to do your PR I’ll merge in a hurry, thank you