Skip to main content
DannyPancratz
VIP ⭐️⭐️⭐️⭐️⭐️
September 12, 2024
Solved

How to force a logout for a user?

  • September 12, 2024
  • 3 replies
  • 53 views

I know this API operation exists and as much as I love using the API, sometimes it’s a hassle to use it for the things I don’t have automated. 

So is there a way to force a logout for a user in Control? 

I’ve been doing something I think would work, but I don’t know for sure. 

  1. Update user’s primary role to Unregistered/Not Logged In + save to apply
  2. Update a users’ primary role back to Registered (or whatever it was before) + save to apply

Does that actually work? 

    Best answer by olimarrio

    Hey @DannyPancratz 👋,

    I’ve given this a test and you can do this by banning a user and then unbanning them immediately after. 

    Counterintuitively, a user remains logged in if you switch primary role to Unregistered/Not Logged In, Save, and then back to what it was before.

    3 replies

    olimarrio
    Gainsight Employee ⭐️
    olimarrioAnswer
    Gainsight Employee ⭐️
    September 13, 2024

    Hey @DannyPancratz 👋,

    I’ve given this a test and you can do this by banning a user and then unbanning them immediately after. 

    Counterintuitively, a user remains logged in if you switch primary role to Unregistered/Not Logged In, Save, and then back to what it was before.

    DannyPancratz
    VIP ⭐️⭐️⭐️⭐️⭐️
    September 13, 2024

    Thanks @olimarrio!

    FYI: I am no longer active in this community
    revote
    VIP ⭐️⭐️⭐️⭐️⭐️
    September 13, 2024

    Can I ask how to know who are logged in users at the moment?