[idp] Handle adding of attributes with a friendly name

This commit is contained in:
Mikaël Ates 2011-09-06 14:44:45 +02:00
parent 3a2c6b370f
commit c373be9eca
2 changed files with 8 additions and 3 deletions

View File

@ -150,6 +150,11 @@ def saml2_add_attribute_values(assertion, attributes):
name, format = key
attribute.nameFormat = format
values = attributes[(name, format)]
elif type(key) is tuple and len(key) == 3:
name, format, nickname = key
attribute.nameFormat = format
attribute.friendlyName = nickname
values = attributes[(name, format, nickname)]
elif type(key) is tuple:
return
else:

View File

@ -14,9 +14,9 @@ Expect a dictionnaries as return with:
- the attributes to add to the response e.g.
- dic = {}
- attributes = {}
- values = [value1, value2]
- attributes[name] = values
- attributes[(name, format)] = values
- attributes[name] = (value1, value2, )
- attributes[(name, format)] = (value1, value2, )
- attributes[(name, format, nickname)] = (value1, value2, )
- dic['attributes'] = attributes
- return dic
'''