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

Add support for common XSD data types in attributes #786

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fontoura
Copy link

@fontoura fontoura commented Mar 21, 2021

The default attribute converter used by PySAML2 does read all attributes as strings. This breaks Django sample projects with SP (https://github.com/peppelinux/djangosaml2) and IdP (https://github.com/OTA-Insight/djangosaml2idp) since boolean user attributes are expected to be either True or False in Python, but are rendered as "true" and "false".

I added a code which checks the {http://www.w3.org/2001/XMLSchema-instance}type attribute on the AttributeValue tags, and converts the values accordingly (my current implementation suppots numbers and booleans only).

@peppelinux
Copy link
Member

@brunato ^

@ThaySolis
Copy link

I was also not succeeding in getting the sample SP and IdP implementation of DjangoSAML2IdP working (here: https://github.com/OTA-Insight/djangosaml2idp/tree/master/example_setup). I pulled these changes by @fontoura locally and they do really fix the issue.

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

Successfully merging this pull request may close these issues.

3 participants