File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ def name_id
9494
9595 alias_method :nameid , :name_id
9696
97+
9798 # Gets the SessionIndex from the AuthnStatement.
9899 # Could be used to be stored in the local session in order
99100 # to be used in a future Logout Request that the SP could
@@ -131,12 +132,18 @@ def attributes
131132 stmt_element . elements . each do |attr_element |
132133 name = attr_element . attributes [ "Name" ]
133134 values = attr_element . elements . collect { |e |
134- # SAMLCore requires that nil AttributeValues MUST contain xsi:nil XML attribute set to "true" or "1"
135- # otherwise the value is to be regarded as empty.
136- [ "true" , "1" ] . include? ( e . attributes [ 'xsi:nil' ] ) ? nil : e . text . to_s
135+ if ( e . elements . nil? || e . elements . size == 0 )
136+ # SAMLCore requires that nil AttributeValues MUST contain xsi:nil XML attribute set to "true" or "1"
137+ # otherwise the value is to be regarded as empty.
138+ [ "true" , "1" ] . include? ( e . attributes [ 'xsi:nil' ] ) ? nil : e . text . to_s
139+ else
140+ e . elements . collect { |f |
141+ [ "true" , "1" ] . include? ( f . attributes [ 'xsi:nil' ] ) ? nil : f . attributes [ 'NameQualifier' ] +"/" +f . text . to_s
142+ }
143+ end
137144 }
138145
139- attributes . add ( name , values )
146+ attributes . add ( name , values . flatten )
140147 end
141148
142149 attributes
You can’t perform that action at this time.
0 commit comments