Creating Client IDs to Obtain AIM Access Tokens
- Last UpdatedNov 06, 2025
- 2 minute read
Custom client applications require an AIM token to access MES. When a valid client ID and client secret are passed to AIM, an AIM access token is returned. This token is then required to be passed to access MES for the current client application user session.
Note: The Default Background User has limited privileges. When MES Web API requests require specific access rights, they may result in access errors. To prevent such issues, ensure that the system attribute is configured with a user account that has the necessary privileges.
The MES installation software includes a Power Shell script that can be used to create the client IDs. You can create as many AIM client IDs as are needed to support the MES custom client applications.
The PowerShell script creates a service-to-service flow.
- For service-to-service, the MES middleware uses the default background user configured for the User ID for background taskssystem attribute (configured in MES Client; attr_id 199 in the System_Attr table). The default entry for this system attribute is Default Background User.
- By default, the lifetime of the token is 24 hours. To change this setting, you can edit the PowerShell script.
To create an AIM client ID
- Open a user session on the node on which the System Management Server is running.
- In the MES installation software on that node, open the \InstallFiles\CD-MES\AIMRegistration folder.
- As an admin user, open the PowerShell script file RegisterAIMServiceClient.ps1.
- Complete the prompts for the following input:
Client ID The client ID to be used by the custom client application.
Client Secret A secret, or password, for the client ID.
User Name (domain\user) and Password A user name and password that has login access to AIM.
After completing entries to these prompts, the client ID registration is performed and you should see a message indicating that the client has been registered successfully. This client ID and client secret can now be used by client applications to obtain AIM access tokens.
For an Application Server-based script example using the client ID and secret to obtain an AIM access token, see Application Server Usage Example.
To configure service-to-service token access when using the MES Web API with MES model-driven application content, see Configuring Support for the MES Web API.