Merge pull request #7696 from betagouv/fix-saml
add saml sp only if vars present
This commit is contained in:
commit
8cd8e6064a
1 changed files with 8 additions and 6 deletions
|
@ -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]
|
||||
|
|
Loading…
Reference in a new issue