Skip to main content
DannyPancratz
VIP ⭐️⭐️⭐️⭐️⭐️
Sep 12, 2024 1:50 PM UTC
Solved

How to force a logout for a user?

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? 

    olimarrio
    olimarrioAnswer
    Gainsight Employee ⭐️
    Sep 13, 2024 11:40 AM UTC

    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 ⭐️
    Sep 13, 2024 11:40 AM UTC

    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.

    Translate
    DannyPancratz
    VIP ⭐️⭐️⭐️⭐️⭐️
    Sep 13, 2024 12:56 PM UTC

    Thanks @olimarrio!

    Translate
    FYI: I am no longer active in this community
    revote
    VIP ⭐️⭐️⭐️⭐️⭐️
    Sep 13, 2024 1:50 PM UTC

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

    Translate