51
Views
7
Comments
How can I implement a sign-out feature that allows  admin to log out other logged-in?
Question

Hello,

I want to implement a feature that allows the Admin to view all logged-in users, regardless of the device they're using. The Admin should also have the ability to log out specific users from the portal and send them a notification.

Can anyone share relevant resources or a working example for this scenario in ODC?

Thanks in advance!


Shashi Mishra

 


2024-04-02 13-23-43
Gonçalo Ferraria
Champion

Hi Shashi,

Based on my knowledge, the only "standard" available action is the User_Logout action. You can create custom logic to log out users by calling this action. However, be cautious, as it logs out the current user session, which means you need to ensure it doesn’t inadvertently log out the admin.

There is an idea to allow passing the user ID to this function, but it is currently on the “Outsystems Radar.” I encourage you to cast your vote for this idea to help prioritize its implementation. 

In the absence of a native solution, there is a post with an example that offers an alternative. Please check out this post: How to log out a specific user. 

Additionally, you can refer to this detailed article on Medium: How to log out a specific user in OutSystems 11 for more insights on the implementation. Is for Outsystems 11, but is easily adapted to ODC.

Let me know if you need any further assistance!

Best regards, 

Gonçalo Ferraria

2021-11-14 02-45-20
Shashi Mishra

Hello,

thank you for quick reply. 

i tried with provided logout action, but there is no option to send userID. 

What I thick first we have to check logged in user condition,After go for logout.

I will check link you shared and back to you for further  assistance if required.

2021-11-14 02-45-20
Shashi Mishra

Hello Gonçalo Ferraria ,

I reviewed the link you shared, but neither solution works for ODC since the server action (User_Logout) isn't available. 

Could you suggest an alternative approach for ODC? 

Thanks in advance.

2025-09-25 14-38-22
Lokesh Kumar Yadav

To implement this feature in OutSystems:

  1. Track Active Sessions: Create a UserSessions entity to store user session details (e.g., UserID, SessionID, device info). Record a session when users log in.

  2. Log Out Specific Users: Provide an Admin interface to view active users from the UserSessions entity. Use the "Logout" action to invalidate a user’s session.

  3. Send Notifications: Use OutSystems built-in notification mechanisms (email, in-app, or push) to notify users when they are logged out.

2021-11-14 02-45-20
Shashi Mishra

Hello lokesh, 

Thank you for reply , I thought in your way but in ODC i stuck. Could you provide more detail?

2019-01-07 16-04-16
Siya
 
MVP

It is not possible for one user to access another user's session and force a logout. Apart from what @Gonçalo Ferraria has shared, you might consider using websockets. All connected devices could subscribe to a channel and listen for messages. When a logout message is received, a client action to log out could be triggered. On the server side, you could build an interface to look up and list subscribed clients from the channel and send messages to log them out. You might use Pusher channels (https://pusher.com/channels/) for this. I don't have a ready-to-use solution implemented, but theoretically, it should work.

2021-11-12 04-59-31
Manikandan Sambasivam

Hi,

Please check the link below, it will give you an idea. 

https://www.outsystems.com/forums/discussion/35093/how-to-log-out-a-specific-user/


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.