Login limitation

Hello everyone, I need to limit login, I’ll try to explain. I would like a user not to be able to log in at the same time (for example by another location) if it is already logged in.
it’s possible?
Sorry for the convoluted question

You can use authentication events to interrupt login process:

Use UserSessionsAPI bean to traverse existing user sessions:

Thank you Alexander…with usersessionapi how i can get the User’s Session’s Last Used to understand if a user is doing something?

Call method getUserSessionInfo(), and then UserSessionEntity.getLastUsedTs()