# Getting started - Login

This section describes how to get started with the Enterprise Manager Python SDK. To help you better understand how to implement the available methods, a code sample and a readme file that describes the code are located in the &lt;Enterprise Manager\_Installation\_Folder&gt;/clients/python folder.

To be able to use the Qlik Enterprise Manager Python API:

1. Import the Qlik Enterprise Manager-Client by adding the following code:

   `from aem_client import *`

2. Create an aem\_client object using the following constructors: `(self, b64_username_password, machine_name, port=443, url="https://{0}/attunityenterprisemanager", verify_certificate=True,authentication_method=AuthenticationMethod.ACTIVE_DIRECTORY):`

   * `b64_username_password`  
     For authentication using Active Directory:  
     You need to create a base64 encoding of “domain\\user:password” as follows:

     * `domain_username` = `'{0}\\{1}'.format(domain, username)`

     * `username_password_str` = `str.encode('{0}:{1}'.format(domain_username, password))`

     * `b64_username_password` = `b64.b64encode(username_password_ str).decode('ascii')`

     For authentication using OpenID Connect:

     Information noteThis login method requires you to be in possession of a Personal Access Token generated in Enterprise Manager. For details, see [Setting up OpenID Connect authentication](https://help.qlik.com/en-US/enterprise-manager/May2025/Content/EnterpriseManager/Main/Installation/Logging_into_AEM.htm)

     You need to create a base64 encoding of “api-token:your-personal-access-token” as follows:

     * `username_password_str` = `str.encode('{0}:{1}'.format('api-token', your-personal-access-token))`

       Where `your-personal-access-token` is the token that was generated for you in Enterprise Manager.

     * `b64_username_password` = `b64.b64encode(username_password_ str).decode('ascii')`

     For authentication using a JWT:

     Information noteThis login method requires you to be in possession of a JWT. For details, see [Logging in to Enterprise Manager with a JWT token via the API](https://help.qlik.com/en-US/enterprise-manager/May2025/Content/EnterpriseManager/Main/Installation/Logging_into_AEM.htm#Logging).

     You need to create a base64 encoding of “api-token:your-personal-access-token” as follows:

     * `username_password_str` = `str.encode('{0}:{1}'.format('jwt', your-jwt))`

       Where `your-jwt` is the actual JWT.

     * `b64_username_password` = `b64.b64encode(username_password_ str).decode('ascii')`

   * `machine_name` - The machine on which Qlik Enterprise Manager is installed.

   * ` port  `– The Qlik Enterprise Manager server port (usually 443).

   * `url` – The URL to the Qlik Enterprise Manager server. If not set then https://{0}/attunityenterprisemanager is used where {0} is the machine name.

   * `verify_certificate` – When verify\_certificate is set to true, there must be a valid certificate in the Qlik Enterprise Manager machine. When set to false, Qlik Enterprise Manager client will not validate the server certificate. The default is true.

     Example:

     `aem_client = AemClient(b64_username_password, machine_name, verify_certificate=False)`

   * `authentication_method` – The authentication method used by the Enterprise Manager server. Specify `AuthenticationMethod.ACTIVE_DIRECTORY` both for Active Directory authentication and OpenID Connect authentication.

   The user can now use the client methods to get/set data from Qlik Enterprise Manager using the public APIs. For example:

   * `aem_client. get_server_list()`
   * `aem_client. get_server_list()`
   * `aem_client. export_task(server_name, task_name)`