File tree 1 file changed +7
-5
lines changed
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)
204
204
When using Devise as an authentication solution, the SP initiated flow can be integrated
205
205
in the ` SessionsController#destroy ` action.
206
206
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
208
208
clears the session and redirect to the ` /spslo ` sub-path to initiate the single logout.
209
209
210
210
Example ` destroy ` action in ` sessions_controller.rb ` :
@@ -214,17 +214,19 @@ class SessionsController < Devise::SessionsController
214
214
# ...
215
215
216
216
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' ]
219
220
super do
220
- session[" saml_uid" ] = saml_uid
221
+ session[' saml_uid' ] = saml_uid
222
+ session[' saml_session_index' ] = saml_session_index
221
223
end
222
224
end
223
225
224
226
# ...
225
227
226
228
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
228
230
user_saml_omniauth_authorize_path + " /spslo"
229
231
else
230
232
super
You can’t perform that action at this time.
0 commit comments