diff --git a/src/esaml.erl b/src/esaml.erl
index e68b981..639bf5c 100644
--- a/src/esaml.erl
+++ b/src/esaml.erl
@@ -293,11 +293,12 @@ decode_assertion_attributes(Xml) ->
[Name] ->
case xmerl_xpath:string("saml:AttributeValue/text()", AttrElem, [{namespace, Ns}]) of
[#xmlText{value = Value}] ->
- [{common_attrib_map(Name), Value} | In];
+ [{common_attrib_map(Name), Value} | [{Name, Value} | In]];
List ->
if (length(List) > 0) ->
Value = [X#xmlText.value || X <- List, element(1, X) =:= xmlText],
- [{common_attrib_map(Name), Value} | In];
+ [{common_attrib_map(Name), Value} | [{Name, Value} | In]];
+
true ->
In
end
@@ -660,7 +661,7 @@ decode_attributes_test() ->
{Doc, _} = xmerl_scan:string("foobartest@test.comgeorgebartest@test.com", [{namespace_conformant, true}]),
Assertion = decode_assertion(Doc),
{ok, #esaml_assertion{attributes = Attrs}} = Assertion,
- [{emailaddress, "test@test.com"}, {foo, ["george", "bar"]}, {mail, "test@test.com"}] = lists:sort(Attrs).
+ [{emailaddress, "test@test.com"}, {foo, ["george", "bar"]}, {mail, "test@test.com"}, {"foo",["george","bar"]}, {"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress", "test@test.com"}, {"urn:oid:0.9.2342.19200300.100.1.3", "test@test.com"}] = lists:sort(Attrs).
decode_solicited_in_response_to_test() ->
{Doc, _} = xmerl_scan:string("foofoofoobarfoobaraudience", [{namespace_conformant, true}]),