Package com.axelor.auth
Class AuthSessionService
java.lang.Object
com.axelor.auth.AuthSessionService
Manages session attributes.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCollection<org.apache.shiro.session.Session> Collection<org.apache.shiro.session.Session> getActiveSessions(User user) Returns all active sessions belonging to the given user.getSessionsData(User user) Returns the list of active sessions for the given user, formatted for front-end consumption.voidterminateSession(String sessionId) Revokes the session identified by the given session ID.voidterminateSession(org.apache.shiro.session.Session session) Revokes the given Shiro session.voidterminateSession(org.apache.shiro.subject.Subject subject) Logs out the given subject, effectively revoking its session and firing logout events.voidterminateSessions(User user, boolean includeCurrentSession) Revokes all active sessions for the given user.
-
Field Details
-
REMOTE_IP
- See Also:
-
USER_AGENT
- See Also:
-
-
Constructor Details
-
AuthSessionService
public AuthSessionService()
-
-
Method Details
-
getActiveSessions
-
getActiveSessions
Returns all active sessions belonging to the given user.- Parameters:
user- the user whose sessions to retrieve- Returns:
- collection of active sessions for the user
-
terminateSession
Revokes the session identified by the given session ID.- Parameters:
sessionId- the ID of the session to revoke
-
terminateSession
public void terminateSession(org.apache.shiro.session.Session session) Revokes the given Shiro session.- Parameters:
session- the session to revoke
-
terminateSession
public void terminateSession(org.apache.shiro.subject.Subject subject) Logs out the given subject, effectively revoking its session and firing logout events.- Parameters:
subject- the subject to log out
-
terminateSessions
Revokes all active sessions for the given user.- Parameters:
user- the user whose sessions to revokeincludeCurrentSession- whether to also revoke the caller's current session
-
getSessionsData
Returns the list of active sessions for the given user, formatted for front-end consumption.Each
UserSessionincludes device info, timestamps as epoch milliseconds, and a flag indicating whether it is the caller's current session.- Parameters:
user- the user whose sessions to retrieve- Returns:
- list of
UserSessionobjects
-