LinkedAuth.get - Python API

Returns a link of security definitions linked to the input SSO user.

Regular users may look up their own linked accounts whereas super-users may provide a user_id to return accounts for.

self.sso.user.get_linked_auth_list

get_linked_auth_list(self, cid, ust, current_app, remote_addr, user_id=None)

  • cid: Correlation ID used by audit log
  • ust: Current user's UST
  • current_app: Name of application the call is made from
  • remote_addr: Current user's remote address
  • user_id: ID of the SSO user to link an account to
  • Returns: A list of dictionaries, each of which describes a single link.

Each dictionary returned is in the format described below:

KeyDatatypeNotes
user_idstringID of the SSO user linked to
auth_typestringType of the definition linked to, will be 'basic_auth' or 'jwt'
auth_usernamestringUsername from the definition linked to
auth_idintID from the definition linked to
creation_timedatetimeWhen the link was created
is_activeboolIs the link active? I.e. can the linked to definition can be used to log a user in?
is_internalboolIs the link internal to Zato? Will be False for all user-defined links, True otherwise.
auth_sourcestringReserved for future use
auth_principalstringReserved for future use
has_ext_principalboolReserved for future use
# -*- coding: utf-8 -*-

# Zato
from zato.server.service import Service

class GetLinks(Service):
    def handle(self):

        # Request metadata
        current_ust = 'gAAAAABc9lm75ETkIfF2Wi8YvRU4szBg_2LGFFg3Fs...'
        current_app = 'CRM'
        remote_addr = '127.0.0.1'

        # ID of the user to return links for
        user_id = 'zusr3tm8jhgqjd9smtdt7erb427s9x'

        # Get user's links
        response = self.sso.user.get_linked_auth_list(self.cid, current_ust,
          current_app, remote_addr, user_id)

        self.logger.info(response)
INFO - [
  {
  'user_id': 'zusr3tm8jhgqjd9smtdt7erb427s9x',
  'auth_type': 'basic_auth',
  'auth_username': 'my.username',
  'auth_id': 2,
  'creation_time': datetime.datetime(2025, 6, 4, 11, 44, 59, 109637),
  'is_active': True,
  'is_internal': False,
  'auth_source': 'reserved',
  'auth_principal': 'reserved',
  'has_ext_principal': False
  }
]