I'm trying to implement ADFS logout in my application, but I'm running into issues due to how cookies are handled during the logout process. Here’s the sequence of events I’m observing:
Login Flow:
- After a successful login to ADFS, the following cookies are set:
MSISAuth
MSISAuth1
- After a successful login to ADFS, the following cookies are set:
Logout Flow:
- When I perform a logout by navigating to
https://...adfs/ls/?wssignout=1.0
, ADFS logs the user out and POSTs a redirect to my endpoint with aSAMLRequest
containing session information. - Upon logout, the following cookies are deleted:
MSISAuth
MSISAuth1
- However, the following new cookie is created:
MSISSignoutProtocol
(with a 10-minute expiry time).
- When I perform a logout by navigating to
Second Login:
- After logging in again in the same browser, the cookies
MSISAuth
andMSISAuth1
are recreated.
- After logging in again in the same browser, the cookies
Logout Behavior on Second Attempt:
- On a subsequent logout attempt in the same browser, the cookies
MSISAuth
andMSISAuth1
may not be deleted, depending on whether theMSISSignoutProtocol
cookie has expired or been deleted.
- On a subsequent logout attempt in the same browser, the cookies
What I've Tried:
- I’ve tried using the
passport-saml.js
saml logout method to generate a logout request, but it didn’t work. - I also tried using the
generateLogoutResponseUrl
method to create aSAMLResponse
, but that didn’t work either.
Problem:
The logout behavior seems to be inconsistent due to the MSISSignoutProtocol
cookie. I’m unable to reliably log out a user once they’ve logged in again, especially after a successful logout. The logout works if I delete or wait for this cookie to expire. I am using passport-saml.
Question:
Has anyone encountered this issue with ADFS logout, and how can I resolve it? Is there a recommended way to handle the MSISSignoutProtocol
cookie or properly implement a logout flow with ADFS using passport-saml.js
?