From 7bbbb6701e79af85b1429ba87013653342cd1708 Mon Sep 17 00:00:00 2001 From: Patricio Cano Date: Wed, 14 Sep 2016 13:57:58 -0500 Subject: [PATCH] feat: Add issuer information to the metadata endpoint, to allow IdPs to properly configure themselves. --- lib/omniauth/strategies/saml.rb | 1 + spec/omniauth/strategies/saml_spec.rb | 3 +++ 2 files changed, 4 insertions(+) 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