saml: handle empty user-roles attributes (#7532)
This commit is contained in:
parent
6455776a42
commit
0504685899
|
@ -431,10 +431,14 @@ class Saml2Directory(Directory):
|
||||||
m = {}
|
m = {}
|
||||||
try:
|
try:
|
||||||
for attribute in assertion.attributeStatement[0].attribute:
|
for attribute in assertion.attributeStatement[0].attribute:
|
||||||
|
# always mark the attribute as being present, even if it won't
|
||||||
|
# have any value, as an empty value (role-slug) must not be
|
||||||
|
# ignored.
|
||||||
|
m.setdefault(attribute.name, [])
|
||||||
try:
|
try:
|
||||||
d[attribute.name] = attribute.attributeValue[0].any[0].content
|
d[attribute.name] = attribute.attributeValue[0].any[0].content
|
||||||
for attribute_value in attribute.attributeValue:
|
for attribute_value in attribute.attributeValue:
|
||||||
l = m.setdefault(attribute.name, [])
|
l = m[attribute.name]
|
||||||
l.append(attribute_value.any[0].content)
|
l.append(attribute_value.any[0].content)
|
||||||
except IndexError:
|
except IndexError:
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in New Issue