Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unicode strings with encoding declaration are not supported #71

Open
johnbarney opened this issue May 3, 2023 · 3 comments
Open

Unicode strings with encoding declaration are not supported #71

johnbarney opened this issue May 3, 2023 · 3 comments

Comments

@johnbarney
Copy link

I'm attempting to get SAML working and am running into the following issue:

[I 2023-05-03 08:04:08.926 JupyterHub samlauthenticator:806] Starting SP-initiated SAML Login
[W 2023-05-03 08:04:08.927 JupyterHub samlauthenticator:402] Got exception when attempting to parse SAML metadata
[W 2023-05-03 08:04:08.927 JupyterHub samlauthenticator:346] Exception: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.
[E 2023-05-03 08:04:08.927 JupyterHub samlauthenticator:714] Error getting SAML Metadata

I've searched documentation and issues and find no reference to Unicode strings. I also checked my SSO provider and found no options related to changing Unicode strings.

My configuration is very basic.
c.JupyterHub.authenticator_class = 'samlauthenticator.SAMLAuthenticator'
c.SAMLAuthenticator.metadata_filepath = '/etc/jupyterhub/metadata.xml'
# Disable creation of system users. User will assigned singleuser container.
c.SAMLAuthenticator.create_system_users = False

I have configured the SP to use urn:oasis:names:tc:SAML:2.0:nameid-format:transient format.

Upon inspecting my SP's metadata I found it included <?xml version="1.0" encoding="UTF-8"?> at the start. Removing encoding="UTF-8" has solved the issue for the moment

It seems like this plugin would be benefit from handling that edge case more gracefully in the future. I'm not well versed in the best way to do that without causing problems for existing users and any PR I submit will likely cause more problems than it'll solve.

@distortedsignal
Copy link
Contributor

Unfortunately, this is a library issue.

I don't have a ton of time to maintain this plugin, so I'm not sure when this is going to get fixed. Thanks for calling it out, but it's pretty low on my priority list these days.

Also -

I'm not well versed in the best way to do that without causing problems for existing users and any PR I submit will likely cause more problems than it'll solve.

I'm not in the users' (user's?) heads, so every change that I make, I see as a breaking change. Don't sweat sending bad PRs. It's part of learning and growing.

@johnbarney
Copy link
Author

johnbarney commented May 4, 2023 via email

@distortedsignal
Copy link
Contributor

I'll leave the issue open (it's sure not closed!). Thanks for understanding. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants