Sha256: 3044b52492915271b301957977faa589b68238e0ca6209ee7d80d22cbaadfd06

Contents?: true

Size: 1.22 KB

Versions: 24

Compression:

Stored size: 1.22 KB

Contents

RSpec.describe "Authentication Request" do
  it 'produces an authentication request' do
    xml = Saml::Kit::Metadata.build_xml do |builder|
      builder.contact_email = 'hi@example.com'
      builder.organization_name = "Acme, Inc"
      builder.organization_url = 'https://www.example.com'
      builder.build_identity_provider do |x|
        x.add_single_sign_on_service('https://www.example.com/login', binding: :http_post)
        x.add_single_sign_on_service('https://www.example.com/login', binding: :http_redirect)
        x.add_single_logout_service('https://www.example.com/logout', binding: :http_post)
        x.name_id_formats = [ Saml::Kit::Namespaces::EMAIL_ADDRESS ]
        x.attributes << :id
        x.attributes << :email
      end
      builder.build_service_provider do |x|
        x.add_assertion_consumer_service('https://www.example.com/consume', binding: :http_post)
        x.add_single_logout_service('https://www.example.com/logout', binding: :http_post)
      end
    end

    idp = Saml::Kit::IdentityProviderMetadata.new(xml)
    url, saml_params = idp.login_request_for(binding: :http_post)

    expect(url).to eql("https://www.example.com/login")
    expect(saml_params['SAMLRequest']).to be_present
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
saml-kit-1.3.0 spec/examples/authentication_request_spec.rb
saml-kit-1.2.0 spec/examples/authentication_request_spec.rb
saml-kit-1.1.0 spec/examples/authentication_request_spec.rb
saml-kit-1.0.31 spec/examples/authentication_request_spec.rb
saml-kit-1.0.30 spec/examples/authentication_request_spec.rb
saml-kit-1.0.29 spec/examples/authentication_request_spec.rb
saml-kit-1.0.28 spec/examples/authentication_request_spec.rb
saml-kit-1.0.27 spec/examples/authentication_request_spec.rb
saml-kit-1.0.26 spec/examples/authentication_request_spec.rb
saml-kit-1.0.25 spec/examples/authentication_request_spec.rb
saml-kit-1.0.24 spec/examples/authentication_request_spec.rb
saml-kit-1.0.23 spec/examples/authentication_request_spec.rb
saml-kit-1.0.22 spec/examples/authentication_request_spec.rb
saml-kit-1.0.21 spec/examples/authentication_request_spec.rb
saml-kit-1.0.20 spec/examples/authentication_request_spec.rb
saml-kit-1.0.19 spec/examples/authentication_request_spec.rb
saml-kit-1.0.18 spec/examples/authentication_request_spec.rb
saml-kit-1.0.17 spec/examples/authentication_request_spec.rb
saml-kit-1.0.16 spec/examples/authentication_request_spec.rb
saml-kit-1.0.15 spec/examples/authentication_request_spec.rb