From d604c5754dabe78839b0c3d3fe98d31acdb34df9 Mon Sep 17 00:00:00 2001 From: Aaron Chapman Date: Fri, 6 Dec 2019 16:54:34 -0500 Subject: [PATCH] LG-2412 associate SAML logout requests without session --- app/controllers/application_controller.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 45595f20fea..c71f42c95d2 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -114,7 +114,7 @@ def permitted_timeout_params end def current_sp - @current_sp ||= sp_from_sp_session || sp_from_request_id + @current_sp ||= sp_from_sp_session || sp_from_request_id || sp_from_request_issuer_logout end def sp_from_sp_session @@ -127,6 +127,12 @@ def sp_from_request_id sp if sp.is_a? ServiceProvider end + def sp_from_request_issuer_logout + return if action_name != 'logout' + issuer_sp = ServiceProvider.from_issuer(saml_request&.service_provider&.identifier) + issuer_sp if issuer_sp.is_a? ServiceProvider + end + def service_provider_request @service_provider_request ||= ServiceProviderRequest.from_uuid(params[:request_id]) end