Perspective Logout Not Logging Out of All Sessions

The problem I’m running into is that when calling the system.perspective.logout function, I believe it is just logging out the user out of the current project.

So to give some context, I have 3 projects in question here and the user starts in the same order: projects 1, 2, and 3. 1 has no permissions so no need to authenticate. Then they navigate to project 2 and authenticate. Then they are passed to project 3 and the authentication from project 2 is passed over.

Now when call logout from project 3, then redirect them back to 1, then they go back to 2, the same user is still logged in.

Does system.perspective.logout just logout the user from the current project? And not any other projects?

Yes, and as I understand it, this is by design.
There’s two separate ‘systems’ at play here - the IdP, and the Perspective session. system.perspective.logout only affects the Perspective session; your IdP session could still be valid. Many third party IdPs may not even allow external logout requests.

You could set Project 2 (and Project 3) to ‘Always Ask the IdP to reauthenticate’, in Project Properties → General:

From project 2 to 3, I don’t want the user to authenticate again. So I would enable this on project 2 only right?

So any time they access project 2 they are required to authenticate.

1 Like

Sure, whatever you need for your requirements. You could also use system.perspective.login (instead of logout); there’s an optional forceAuth parameter that tries to force a login window when you switch. It might be harder to detect a transfer from 3 → 2 in that scenario, though.