Terminating a User Session from a DX Component

We’ve created a DX component to help us with our tenant separation needs. Users can change context via an external identity management tool installed on their Windows desktops, and our Pega widget listens to event changes.

Once a context switch happens, we may need to take action specific to the business application. For example, when a user changes from the development environment to production via that tool, we need to terminate their session immediately. If they switch from one tenant to another, we may need to update their access groups dynamically.

So far we can successfully call a REST service rule via our widget, and this approach seems promising as it provides us with the most flexibility (you can simply call an activity). I tried calling the OOTB Logoff activity, but this didn’t didn’t work - I assume this is for Traditional apps only.

My questions:

  • How should I properly terminate the user session?
  • Is there an alternative to using a REST service rule plus an activity? I know it’s not ideal, but this approach would allow us to separate configuration from the component itself (I don’t want business logic embedded in code).

Hello @mrwolf2

I had a look at the PConn and PCore methods, however i did not find any specific method to terminate a user session.

I understood the approach to call the Custom Rest API itself to call an OOTB activity to invalidate the session. May be the activity which you have used is not enough i guess. Also i believe the invalidation of the session should happen asynchronously in the background as the user has moved to another URL altogether.

I will also have a look at this in detail.

Regards

JC