Sha256: 1a83ed44fc8feea7d513f0d829611d644e4869e3f170a3c8c81823e9e8c70f69

Contents?: true

Size: 811 Bytes

Versions: 6

Compression:

Stored size: 811 Bytes

Contents

module Saml
  class Response
    include Saml::ComplexTypes::StatusResponseType

    tag "Response"
    has_many :assertions, Saml::Assertion
    has_many :encrypted_assertions, Saml::Elements::EncryptedAssertion

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

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

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

    def assertion
      assertions.first
    end

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

    def encrypted_assertion
      encrypted_assertions.first
    end

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
libsaml-2.1.7 lib/saml/response.rb
libsaml-2.1.6 lib/saml/response.rb
libsaml-2.1.5 lib/saml/response.rb
libsaml-2.1.4 lib/saml/response.rb
libsaml-2.1.3 lib/saml/response.rb
libsaml-2.1.2 lib/saml/response.rb