Merge pull request #7696 from betagouv/fix-saml

add saml sp only if vars present
This commit is contained in:
krichtof 2022-08-29 08:55:36 +02:00 committed by GitHub
commit 8cd8e6064a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,12 +17,14 @@ if ENV['SAML_IDP_ENABLED'] == 'enabled'
}
}
service_providers = {
"https://#{ENV.fetch('SAML_DOLIST_HOST')}" => {
response_hosts: [ENV.fetch('SAML_DOLIST_HOST')],
cert: ENV.fetch("SAML_DOLIST_CERTIFICATE")
}
}
service_providers = {}
if ENV['SAML_DOLIST_HOST'].present?
service_providers["https://#{ENV.fetch('SAML_DOLIST_HOST')}"] =
{
response_hosts: [ENV.fetch('SAML_DOLIST_HOST')],
cert: ENV.fetch("SAML_DOLIST_CERTIFICATE")
}
end
config.service_provider.finder = -> (entity_id) do
service_providers[entity_id]