Logout all users in Oracle Apex

483 Views Asked by At

I have an application in which before every release we lock all users. Once locked, user cannot login. But if the user is already logged in and then I lock the user, the user will be able to continue until sessions ends.

I'm trying to have a feature so that when I lock all users, all current active sessions of that app should be logged out or ended.

I have tried looping for all active sessions and executing apex_authentication.logout and passing session ID and app ID for each of them. Somehow if doesn't end session of anybody except the user performing the process.

2

There are 2 best solutions below

0
On BEST ANSWER

Instead of using logout, apex_authentication.logout I'm using apex_session.delete_session. It's not 'really' a logout, but does does the job of stopping current user session. Refer https://docs.oracle.com/database/apex-18.1/AEAPI/APEX_SESSION.htm#AEAPI-GUID-E37F7000-633D-466C-BA8F-0051EDB7A0CC

3
On

Given your reference to apex_authentication.logout, I'm assuming that you're dealing with an APEX application. In my experience, you don't worry about ending user sessions or locking users when performing an upgrade on an APEX app. Instead, you change the Build Status of the application to "Unavailable" in the "Manage Service / Application Build Status" page of the APEX workspace. This renders the application inaccessible to all users, immediately. After the upgrade, change the status back to "Available".