automate creation and deletion of users accounts when logging in and out of cache.

Is their a way to (setup) automate the removal of users accounts from the system once they have logged out of cache and than recreate them once they log in, so basically the user list only contains live logged in users plus some of the default user accounts.

  • 0
  • 0
  • 71
  • 2
  • 2

Answers

Hi Richard,

You can create and delete accounts via the %SYS namespace using the following class methods...

https://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=%25SYS&CLASSNAME=Security.Users

It sounds like you might want to take a look at delegated authentication as well...

https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GCAS_delegated

If this is just for a CSP application then you can  detect the user logging out or a session timeout using the %CSP.SessionEvents class.

Sean.

The Audit Log can actually give you that information already.  If you audit Login and Logout events you can then use SQL to see what's going on in the system.  Here's a query to get started (in the %SYS namespace):

SELECT UTCTimeStamp,Username,Event
 FROM %SYS.Audit

Comments

Just seeing if it is possible,  the end goal is so that we only have live users setup on the system and don't have any dormant accounts laying around