Class: SAML::Core::Response

Inherits:
StatusResponse show all
Defined in:
lib/saml/core/response.rb

Instance Attribute Summary collapse

Attributes inherited from StatusResponse

#id, #status, #version

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from StatusResponse

#success?

Instance Attribute Details

#assertionsObject (readonly)

Returns the value of attribute assertions.



7
8
9
# File 'lib/saml/core/response.rb', line 7

def assertions
  @assertions
end

Class Method Details

.from_xml(xml) ⇒ Object



9
# File 'lib/saml/core/response.rb', line 9

def self.from_xml(xml); new.from_xml(xml); end

Instance Method Details

#from_xml(xml) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/saml/core/response.rb', line 11

def from_xml(xml)
  super(xml)
  @xml = xml

  @assertions = xml.get_elements('saml:Assertion').map do |a|
    Assertion.from_xml(a)
  end
  
  self
end

#valid?(expected_certificate) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/saml/core/response.rb', line 22

def valid?(expected_certificate)
  XMLSignature.new(@xml).verify(expected_certificate)
end