Closed (fixed)
Project:
simpleSAMLphp Authentication
Version:
8.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Jul 2016 at 11:32 UTC
Updated:
18 Sep 2023 at 12:13 UTC
Jump to comment: Most recent
Comments
Comment #2
dpagini commentedI am having a very similar problem with custom logout redirects. SimpleSAMLPHP allows you to set a logout redirect URL, but not really dynamically. Since `simplesamlphp_auth_user_logout()` hijacks the logout stack, my custom redirect code gets completely skipped. This PR would help me with some of that issue if it only affects the SAML users (employees) and not our end clients.
Just a question, the Drupal core `user_logout` function uses the `session_handler` service, which I sort of think SimpleSaml should do as well, and set the user to anonymous, since that code is being "skipped".
So it seems like the "session_destory()" line should be replaced with the following...
Thoughts?
Comment #3
dpagini commentedComment #4
dpagini commentedI've been using this patch and it is working successfully for me. I'm going to mark as RTBC. I'm going to open a new ticket for my suggestion in comment #2 and submit my own patch, since it is sort of a separate issue.
Comment #5
trwill commentedDoes anything else need to be done for this patch?
The hook_user_logout function is very heavy handed and basically breaks any other hooks and/or event subscribers that are running on logout. This is exactly the fix needed for those.
Comment #6
joelpittetThis may need a reroll if #2900442: Use Drupal session manager in logout gets in first.
RTBC++
Comment #7
dakku commentedThanks guys, I will get this committed later today.
Comment #9
dakku commentedComment #11
partyka commentedHi,
Thank you for fixing this -- but I've noticed it's still in the 'dev' branch and yet to be incorporated into a released version. Please consider this a request to make a new release with this fix in it.
Thanks!
--partyka
Comment #12
kuldeep k commentedDoes it also work for another custom "hook_user_logout"? I want to destroy some extra cookies when user getting logged out but saml logout won't allow me to do that from my custom logout.
Comment #13
etiennejacquot commentedWas this ever fixed? I still get issues using 8.x-2.0-rc4 on Drupal 9.5.9 when trying to masquerade as a SAML authenticated user
Error: Call to undefined method Drupal\user\Entity\User::setAccount() in simplesamlphp_auth_user_logout() (line 68 of /code/web/modules/contrib/simplesamlphp_auth/simplesamlphp_auth.module)