From 8301b7a3e453642c8b78dc446139bd2ea31ba4db Mon Sep 17 00:00:00 2001 From: miguelp Date: Wed, 15 May 2013 11:07:12 +0200 Subject: [PATCH] Packing elements with the same Name in a single attribute as an Array (enables the retrieval of all the roles specified for a given user) --- lib/onelogin/saml/response.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/onelogin/saml/response.rb b/lib/onelogin/saml/response.rb index eed781326..ebaf9b454 100644 --- a/lib/onelogin/saml/response.rb +++ b/lib/onelogin/saml/response.rb @@ -48,7 +48,12 @@ def attributes name = attr_element.attributes["Name"] value = attr_element.elements.first.text - result[name] = value + result[name] = + if result[name] + ([value] << result[name]).flatten + else + value + end end result.keys.each do |key|