diff --git a/src/saml2/saml.py b/src/saml2/saml.py index 0100033..90434b2 100644 --- a/src/saml2/saml.py +++ b/src/saml2/saml.py @@ -855,7 +855,7 @@ def _decode_attribute_value(typ, text): return str(float(text)) if typ == XSD + "boolean": return "%s" % (text == "true") - if typ == NS_SOAP_ENC + "base64": + if typ == XSD + "base64Binary": import base64 return base64.decodestring(text) raise ValueError("type %s not supported" % type) diff --git a/src/saml2/utils.py b/src/saml2/utils.py index 324c514..755a4c7 100644 --- a/src/saml2/utils.py +++ b/src/saml2/utils.py @@ -168,7 +168,7 @@ def make_instance(klass, spec, base64encode=False): if base64encode: import base64 val = base64.encodestring(val) - setattr(klass_inst, "type", saml.NS_SOAP_ENC + "base64") + setattr(klass_inst, "type", "xs:base64Binary") else: if isinstance(val, basestring): print "basestring" diff --git a/tests/test_01_saml.py b/tests/test_01_saml.py index c21893b..8b1cffa 100644 --- a/tests/test_01_saml.py +++ b/tests/test_01_saml.py @@ -400,7 +400,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" Name="FirstName"> VU5JTkVUVA== +xsi:type="xs:base64Binary">VU5JTkVUVA== """ X500_AV = """ diff --git a/tests/test_11_utils.py b/tests/test_11_utils.py index c2e7dc2..bfd5565 100644 --- a/tests/test_11_utils.py +++ b/tests/test_11_utils.py @@ -152,7 +152,7 @@ def test_attribute_base64(): assert inst.name == "name" assert len(inst.attribute_value) == 1 av = inst.attribute_value[0] - assert av.type == "http://schemas.xmlsoap.org/soap/encoding/base64" + assert av.type == "xs:base64Binary" assert av.text.strip() == "U2VsbWEgTGFnZXJsw7Zm" def test_attribute_statement():