Class: Saml::Response

Inherits:
Object
  • Object
show all
Includes:
ComplexTypes::StatusResponseType
Defined in:
lib/saml/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ComplexTypes::StatusResponseType

#initialize, #success?

Methods included from ComplexTypes::RequestAbstractType

#initialize, #provider

Methods included from XMLHelpers

#add_signature, #to_soap, #to_xml

Instance Attribute Details

#xml_valueObject

Returns the value of attribute xml_value.



5
6
7
# File 'lib/saml/response.rb', line 5

def xml_value
  @xml_value
end

Instance Method Details

#assertionObject



47
48
49
# File 'lib/saml/response.rb', line 47

def assertion
  assertions.first
end

#assertion=(assertion) ⇒ Object



51
52
53
# File 'lib/saml/response.rb', line 51

def assertion=(assertion)
  (self.assertions ||= []) << assertion
end

#authn_failed?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/saml/response.rb', line 11

def authn_failed?
  !success? && status.status_code.authn_failed?
end

#decrypt_assertions(private_key) ⇒ Object



39
40
41
42
43
44
45
# File 'lib/saml/response.rb', line 39

def decrypt_assertions(private_key)
  @assertions ||= []
  encrypted_assertions.each do |encrypted_assertion|
    @assertions << Saml::Util.decrypt_assertion(encrypted_assertion, private_key)
  end
  encrypted_assertions.clear
end

#encrypt_assertions(certificate) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/saml/response.rb', line 31

def encrypt_assertions(certificate)
  @encrypted_assertions = []
  assertions.each do |assertion|
    @encrypted_assertions << Saml::Util.encrypt_assertion(assertion, certificate)
  end
  assertions.clear
end

#encrypted_assertionObject



55
56
57
# File 'lib/saml/response.rb', line 55

def encrypted_assertion
  encrypted_assertions.first
end

#encrypted_assertion=(encrypted_assertion) ⇒ Object



59
60
61
# File 'lib/saml/response.rb', line 59

def encrypted_assertion=(encrypted_assertion)
  (self.encrypted_assertions ||= []) << encrypted_assertion
end

#no_authn_context?Boolean

Returns:

  • (Boolean)


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

def no_authn_context?
  !success? && status.status_code.no_authn_context?
end

#request_denied?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/saml/response.rb', line 15

def request_denied?
  !success? && status.status_code.request_denied?
end

#request_unsupported?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/saml/response.rb', line 19

def request_unsupported?
  !success? && status.status_code.request_unsupported?
end

#unknown_principal?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/saml/response.rb', line 27

def unknown_principal?
  !success? && status.status_code.unknown_principal?
end