pysaml2 icon indicating copy to clipboard operation
pysaml2 copied to clipboard

Add support for common XSD data types in attributes

Open fontoura opened this issue 4 years ago • 2 comments

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).

fontoura avatar Mar 21 '21 19:03 fontoura

@brunato ^

peppelinux avatar Mar 21 '21 19:03 peppelinux

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.

ThaySolis avatar May 20 '21 18:05 ThaySolis