Sha256: b5780cdc0d263658f1fd599462870778a79ece91670201de89d29181a4fbd9bc

Contents?: true

Size: 844 Bytes

Versions: 12

Compression:

Stored size: 844 Bytes

Contents

module Saml
  module Kit
    module Bindings
      class HttpPost < Binding
        include Serializable

        def initialize(location:)
          super(binding: Saml::Kit::Bindings::HTTP_POST, location: location)
        end

        def serialize(builder, relay_state: nil)
          builder.destination = location
          document = builder.build
          saml_params = {
            document.query_string_parameter => Base64.strict_encode64(document.to_xml),
          }
          saml_params['RelayState'] = relay_state if relay_state.present?
          [location, saml_params]
        end

        def deserialize(params, configuration: Saml::Kit.configuration)
          xml = decode(saml_param_from(params))
          Saml::Kit::Document.to_saml_document(xml, configuration: configuration)
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
saml-kit-0.2.17 lib/saml/kit/bindings/http_post.rb
saml-kit-0.2.16 lib/saml/kit/bindings/http_post.rb
saml-kit-0.2.15 lib/saml/kit/bindings/http_post.rb
saml-kit-0.2.14 lib/saml/kit/bindings/http_post.rb
saml-kit-0.2.13 lib/saml/kit/bindings/http_post.rb
saml-kit-0.2.12 lib/saml/kit/bindings/http_post.rb
saml-kit-0.2.11 lib/saml/kit/bindings/http_post.rb
saml-kit-0.2.10 lib/saml/kit/bindings/http_post.rb
saml-kit-0.2.9 lib/saml/kit/bindings/http_post.rb
saml-kit-0.2.8 lib/saml/kit/bindings/http_post.rb
saml-kit-0.2.7 lib/saml/kit/bindings/http_post.rb
saml-kit-0.2.6 lib/saml/kit/bindings/http_post.rb