File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -347,7 +347,22 @@ def get_attributes(self):
347347 attr_name = attribute_node .get ('Name' )
348348 values = []
349349 for attr in attribute_node .iterchildren ('{%s}AttributeValue' % OneLogin_Saml2_Constants .NSMAP ['saml' ]):
350- values .append (attr .text )
350+ # Remove any whitespace (which may be present where attributes are
351+ # nested inside NameID children).
352+ text = attr .text .strip ()
353+ if text :
354+ values .append (text )
355+
356+ # Parse any nested NameID children
357+ for nameid in attr .iterchildren ('{%s}NameID' % OneLogin_Saml2_Constants .NSMAP ['saml' ]):
358+ values .append ({
359+ 'NameID' : {
360+ 'Format' : nameid .get ('Format' ),
361+ 'NameQualifier' : nameid .get ('NameQualifier' ),
362+ 'value' : nameid .text
363+ }
364+ })
365+
351366 attributes [attr_name ] = values
352367 return attributes
353368
You can’t perform that action at this time.
0 commit comments