Skip to content

Commit 5cef508

Browse files
committed
Fixed friendlyname
1 parent e594bb8 commit 5cef508

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/onelogin/saml2/response.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -613,12 +613,6 @@ def get_friendlyname_attributes(self):
613613
for attribute_node in attribute_nodes:
614614
attr_friendlyname = attribute_node.get('FriendlyName')
615615
if attr_friendlyname:
616-
if attr_friendlyname in attributes.keys():
617-
raise OneLogin_Saml2_ValidationError(
618-
'Found an Attribute element with duplicated FriendlyName',
619-
OneLogin_Saml2_ValidationError.DUPLICATED_ATTRIBUTE_NAME_FOUND
620-
)
621-
622616
values = []
623617
for attr in attribute_node.iterchildren('{%s}AttributeValue' % OneLogin_Saml2_Constants.NSMAP['saml']):
624618
attr_text = OneLogin_Saml2_XML.element_text(attr)
@@ -636,7 +630,10 @@ def get_friendlyname_attributes(self):
636630
'value': nameid.text
637631
}
638632
})
639-
attributes[attr_friendlyname] = values
633+
if attr_friendlyname in attributes:
634+
attributes[attr_friendlyname].extend(values)
635+
else:
636+
attributes[attr_friendlyname] = values
640637
return attributes
641638

642639
def validate_num_assertions(self):

0 commit comments

Comments
 (0)