Skip to content

Commit 7bbbb67

Browse files
committed
feat: Add issuer information to the metadata endpoint, to allow IdPs to properly configure themselves.
1 parent 1432605 commit 7bbbb67

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

lib/omniauth/strategies/saml.rb

+1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ def other_phase
115115
settings = OneLogin::RubySaml::Settings.new(options)
116116
if options.request_attributes.length > 0
117117
settings.attribute_consuming_service.service_name options.attribute_service_name
118+
settings.issuer = options.issuer
118119
options.request_attributes.each do |attribute|
119120
settings.attribute_consuming_service.add_attribute attribute
120121
end

spec/omniauth/strategies/saml_spec.rb

+3
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ def post_xml(xml=:example_response)
207207

208208
describe 'GET /auth/saml/metadata' do
209209
before do
210+
saml_options[:issuer] = 'http://example.com/SAML'
210211
get '/auth/saml/metadata'
211212
end
212213

@@ -220,6 +221,8 @@ def post_xml(xml=:example_response)
220221
expect(last_response.body).to match /first_name/
221222
expect(last_response.body).to match /last_name/
222223
expect(last_response.body).to match /Required attributes/
224+
expect(last_response.body).to match /entityID/
225+
expect(last_response.body).to match /http:\/\/example.com\/SAML/
223226
end
224227
end
225228

0 commit comments

Comments
 (0)