Azure SAML Logout Behavior

Brad Hill 21 Reputation points
2022-11-28T19:37:25.61+00:00

Using Azure Active Directory, we have created several enterprise applications for use with SAML authentication. When a user logs out of any one of those applications, all open (SAML authenticated) applications are automatically logged out as well. Is there a way to control this behavior? I prefer for only the one application to be logged out without disturbing other SAML apps. Then if the user goes back to that one application, they have to login again. Is that possible?

Microsoft Security Microsoft Entra Microsoft Entra ID
{count} votes

Accepted answer
  1. Marilee Turscak-MSFT 37,206 Reputation points Microsoft Employee Moderator
    2022-12-02T07:25:26.337+00:00

    Yes, not using the optional logout URL will serve the purpose, since the optional logout URL is used to send users to a place/page once the logout is complete. The session creator (in this case, Azure AD) signals logout by performing a broadcast to all participating applications in the principal's context. If applications decide to do nothing about this broadcast by Azure AD (by not redirecting users elsewhere) they will stay on the same page where they were previously located. So your solution should work.

    Otherwise, the solution depends on the application config, since we don’t own the application code or logic. The SAML handlers/libraries are used by RP-STS/RP Apps responsible to generate and respond to logout requests. The logic would need to be set up to ignore those requests.

    All applications participating in the session (Principal/NameID) where the app is initiating a logout will receive a logout request back from Azure AD. This is a broadcast to all resource providers participating in that session with the relevant principal. If Azure AD receives a response back to this logout request (from any other applications participating in the session), Azure AD terminates the session with those resource providers.

    So everything depends on whether the other applications in the session respond to the logout request sent by Azure AD. If the other applications in the session ignore this logout request, the user will not be logged out from those apps.

    Section 3.7 of the SAML 2.0 core specification describes that there can be multiple participants (other applications) in a session besides your application. If one of the other participants sends a LogoutRequest to the Microsoft identity platform (the session authority), it will send a LogoutRequest back to all the session participants except the participant who sent the initial LogoutRequest. If another participant simultaneously initiated sign-out, there would be a race to see which LogoutRequest reaches Microsoft identity platform first. Therefore, an application should always be prepared to handle a LogoutRequest.

    You would need to test for any abnormal behavior since there are benefits to the single logout approach.

    -

    If the information helped you, please Accept the answer. This will help us and other community members as well.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Brad Hill 21 Reputation points
    2022-11-30T17:42:45.243+00:00

    I think the behavior I want can be accomplished by not providing the optional logout URL in the application's SAML configuration. I noticed that apps without the logout URL provided are not being signed out automatically when I log out of other apps. Additionally, for those apps that are left open, I can close the browser tab and come back to them in another tab without having to log back in. Only closing the browser completely logs them out. It seems I have more testing to do, but I think I've found my answer.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.