Skip to content

Commit 0605bdf

Browse files
committed
SLO endpoint missing warning - fixes #36
1 parent 49a7e96 commit 0605bdf

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

lib/samly/idp_data.ex

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ defmodule Samly.IdpData do
102102
|> load_metadata(idp_config)
103103
|> override_nameid_format(idp_config)
104104
|> update_esaml_recs(service_providers, idp_config)
105+
|> verify_slo_url()
105106
end
106107

107108
@spec save_idp_config(%IdpData{}, map()) :: %IdpData{}
@@ -170,6 +171,15 @@ defmodule Samly.IdpData do
170171
end
171172
end
172173

174+
@spec verify_slo_url(%IdpData{}) :: %IdpData{}
175+
defp verify_slo_url(%IdpData{} = idp_data) do
176+
if idp_data.valid? && idp_data.slo_redirect_url == nil && idp_data.slo_post_url == nil do
177+
Logger.warn("[Samly] SLO Endpoint missing in [#{inspect(idp_data.metadata_file)}]")
178+
end
179+
180+
idp_data
181+
end
182+
173183
@default_metadata_file "idp_metadata.xml"
174184

175185
@spec set_metadata_file(%IdpData{}, map()) :: %IdpData{}

0 commit comments

Comments
 (0)