question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Azure AD B2C integration failure - 'utf8' is not a supported encoding name

See original GitHub issue

The 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:closed
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
peppelinuxcommented, Dec 22, 2020

It’s patched in RC so It’s in the future stable release

1reaction
peppelinuxcommented, Dec 22, 2020

Yes, feel free to do your PR I’ll merge in a hurry, thank you

Read more comments on GitHub >

github_iconTop Results From Across the Web

Does the Azure AD B2C Graph endpoint support UTF-8 ...
I have a custom policy XML document that contains characters that need UTF-8 to be rendered correctly (A country name of Curaçao).
Read more >
Does the Azure AD B2C Graph endpoint ... - Stack Overflow
The following post helped: Deploy custom policies with Azure Pipelines changing the charset encoding. Change
Read more >
Redirect URI not working on Android · Issue #22 - GitHub
Try this as is changing appid, it works for me, also check that your redirect url is right in Azure. <?xml version="1.0" encoding="utf-...
Read more >
A Walkthrough For Azure AD B2C Custom Policy (Identity ...
For the folks who try to edit custom policies by oneself, here we walkthrough the policy structure in Azure AD B2C custom policy....
Read more >
Customize the look and feel of your Azure AD B2C page
Azure AD B2C at its base is a username and password database that you ... charset=UTF-8"> <meta name="viewport" content="width=device-width, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found