add saml sp only if vars present

This commit is contained in:
Christophe Robillard 2022-08-25 21:31:14 +02:00
parent ac246c6775
commit f77c0fdfe4

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]