pysaml2
pysaml2 copied to clipboard
Add support for common XSD data types in attributes
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).
@brunato ^
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.