Skip to content

Commit 9478e8b

Browse files
author
Ana Martinez
committed
Add support to get an array of name_id_options
1 parent 224f966 commit 9478e8b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/samlr/assertion.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ def name_id
5151
@name_id ||= assertion.at("./saml:Subject/saml:NameID", NS_MAP).text
5252
end
5353

54+
def name_id_options
55+
@name_id_options ||= Hash[assertion.at("./saml:Subject/saml:NameID", NS_MAP).attributes.map{|k,v| [k, v.value]}]
56+
end
57+
5458
def conditions
5559
@conditions ||= Condition.new(assertion.at("./saml:Conditions", NS_MAP), options)
5660
end

lib/samlr/response.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Samlr
77
class Response
88
extend Forwardable
99

10-
def_delegators :assertion, :name_id, :attributes
10+
def_delegators :assertion, :name_id, :attributes, :name_id_options
1111
attr_reader :document, :options
1212

1313
def initialize(data, options)

0 commit comments

Comments
 (0)