Sha256: 2244e2a3acf6dd36f62eae73453e63ab2f0ec17cd84d42439defdd4bbf2650dd

Contents?: true

Size: 992 Bytes

Versions: 3

Compression:

Stored size: 992 Bytes

Contents

module Saml
  module Kit
    class AuthenticationRequest < Document
      include Requestable

      def initialize(xml, configuration: Saml::Kit.configuration)
        super(xml, name: "AuthnRequest", configuration: configuration)
      end

      def assertion_consumer_service_url
        to_h[name]['AssertionConsumerServiceURL']
      end

      def name_id_format
        to_h[name]['NameIDPolicy']['Format']
      end

      def response_for(user, binding:, relay_state: nil)
        response_binding = provider.assertion_consumer_service_for(binding: binding)
        builder = Saml::Kit::Response.builder(user, self) do |x|
          x.sign = provider.want_assertions_signed
          yield x if block_given?
        end
        response_binding.serialize(builder, relay_state: relay_state)
      end

      Builder = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('Saml::Kit::AuthenticationRequest::Builder', 'Saml::Kit::Builders::AuthenticationRequest')
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
saml-kit-0.2.6 lib/saml/kit/authentication_request.rb
saml-kit-0.2.5 lib/saml/kit/authentication_request.rb
saml-kit-0.2.4 lib/saml/kit/authentication_request.rb