diff --git a/lib/omniauth/strategies/saml.rb b/lib/omniauth/strategies/saml.rb index 74be466..d2f1d05 100644 --- a/lib/omniauth/strategies/saml.rb +++ b/lib/omniauth/strategies/saml.rb @@ -115,6 +115,7 @@ def other_phase settings = OneLogin::RubySaml::Settings.new(options) if options.request_attributes.length > 0 settings.attribute_consuming_service.service_name options.attribute_service_name + settings.issuer = options.issuer options.request_attributes.each do |attribute| settings.attribute_consuming_service.add_attribute attribute end diff --git a/spec/omniauth/strategies/saml_spec.rb b/spec/omniauth/strategies/saml_spec.rb index b907d48..5ce4b79 100644 --- a/spec/omniauth/strategies/saml_spec.rb +++ b/spec/omniauth/strategies/saml_spec.rb @@ -207,6 +207,7 @@ def post_xml(xml=:example_response) describe 'GET /auth/saml/metadata' do before do + saml_options[:issuer] = 'http://example.com/SAML' get '/auth/saml/metadata' end @@ -220,6 +221,8 @@ def post_xml(xml=:example_response) expect(last_response.body).to match /first_name/ expect(last_response.body).to match /last_name/ expect(last_response.body).to match /Required attributes/ + expect(last_response.body).to match /entityID/ + expect(last_response.body).to match /http:\/\/example.com\/SAML/ end end