Support Center
Consult documentation of the corresponding REST endpoint for an overview.
get_list(self, cid, ust, target_ust, current_ust, current_app, remote_addr)
Returns details of a session pointed to by target_ust.
cid
: Correlation ID used by audit logust
: Current user's UST to return sessions bytarget_ust
: UST of the session to return details ofcurrent_ust
: Current user's UST (must belong to a super-user)current_app
: Name of application the current user is issuing the call fromremote_addr
: Current user's remote addressuser_agent
: User agent stringReturns
: A list of dictionaries, each describing an individual sessions, the meaning of each dictionary's keys is the same as in the REST endpoint# -*- coding: utf-8 -*-
# Zato
from zato.server.service import Service
class GetSessionList(Service):
def handle(self):
username = 'admin1'
password = 'hQ9nl93UDqGus'
current_app = 'CRM'
remote_addr = '127.0.0.1'
user_agent = 'Firefox 139.0'
# Log current user
session = self.sso.user.login(self.cid, username, password, current_app,
remote_addr, user_agent)
# Get UST
ust = session.ust
# Get current user's session
session_list = self.sso.user.session.get_list(self.cid, ust, None, None,
current_app, remote_addr, user_agent)
# Log information about each of the sessions found
for item in session_list:
self.logger.info('Auth type / principal / remote address: %s %s %s',
item['auth_type'], item['auth_principal'], item['remote_addr'])