File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -204,7 +204,7 @@ advertised in metadata by setting the `single_logout_service_url` config option)
204204When using Devise as an authentication solution, the SP initiated flow can be integrated
205205in the ` SessionsController#destroy ` action.
206206
207- For this to work it is important to preserve the ` saml_uid ` value before Devise
207+ For this to work it is important to preserve the ` saml_uid ` and ` saml_session_index ` value before Devise
208208clears the session and redirect to the ` /spslo ` sub-path to initiate the single logout.
209209
210210Example ` destroy ` action in ` sessions_controller.rb ` :
@@ -214,17 +214,19 @@ class SessionsController < Devise::SessionsController
214214 # ...
215215
216216 def destroy
217- # Preserve the saml_uid in the session
218- saml_uid = session[" saml_uid" ]
217+ # Preserve the saml_uid and saml_session_index in the session
218+ saml_uid = session[' saml_uid' ]
219+ saml_session_index = session[' saml_session_index' ]
219220 super do
220- session[" saml_uid" ] = saml_uid
221+ session[' saml_uid' ] = saml_uid
222+ session[' saml_session_index' ] = saml_session_index
221223 end
222224 end
223225
224226 # ...
225227
226228 def after_sign_out_path_for (_ )
227- if session[' saml_uid' ] && SAML_SETTINGS .idp_slo_target_url
229+ if session[' saml_uid' ] && session[ ' saml_session_index ' ] && SAML_SETTINGS .idp_slo_target_url
228230 user_saml_omniauth_authorize_path + " /spslo"
229231 else
230232 super
You can’t perform that action at this time.
0 commit comments