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.0.14 spec/examples/authentication_request_spec.rb
saml-kit-1.0.13 spec/examples/authentication_request_spec.rb
saml-kit-1.0.12 spec/examples/authentication_request_spec.rb
saml-kit-1.0.11 spec/examples/authentication_request_spec.rb