main
1RSpec.describe "Identity Provider Metadata" do
2 it 'produces identity provider metadata' do
3 xml = Saml::Kit::Metadata.build_xml do |builder|
4 builder.contact_email = 'hi@example.com'
5 builder.organization_name = "Acme, Inc"
6 builder.organization_url = 'https://www.example.com'
7 builder.build_identity_provider do |x|
8 x.add_single_sign_on_service('https://www.example.com/login', binding: :http_post)
9 x.add_single_sign_on_service('https://www.example.com/login', binding: :http_redirect)
10 x.add_single_logout_service('https://www.example.com/logout', binding: :http_post)
11 x.name_id_formats = [ Saml::Kit::Namespaces::EMAIL_ADDRESS ]
12 x.attributes << :id
13 x.attributes << :email
14 end
15 end
16 expect(xml).to be_present
17 expect(xml).to have_xpath("//md:EntityDescriptor//md:IDPSSODescriptor")
18 expect(xml).to_not have_xpath("//md:EntityDescriptor//md:SPSSODescriptor")
19 end
20end