Generate Service Credentials

Service Credentials generation is broken into two steps:

  1. A one-time Technical Account creation by an Adobe IMS Org administrator
  2. The download and use of the Technical Account’s Service Credentials JSON

Create a Technical Account

Service Credentials, unlike Local Development Access Tokens, require a Technical Account to be created by an Adobe Org IMS Administrator before they can be downloaded. Discrete Technical Accounts should be created for each client that requires programmatic access to AEM.

Create a Technical Account

Technical Accounts are created once, however the Private Keys uses to manage Service Credentials associated with the Technical Account can be managed over time. For example, new Private Key/Service Credentials must be generated prior to the current Private Key’s expiration, to allow for uninterrupted access by a user of the Service Credentials.

  1. Ensure you are logged in as a:

    • Adobe IMS Org’s System Administrator
    • Member of the AEM Administrators IMS Product Profile on AEM Author
  2. Log in to Adobe Cloud Manager

  3. Open the Program containing the AEM as a Cloud Service environment to integrate set up the Service Credentials for

  4. Tap the ellipsis next to the environment in the Environments section, and select Developer Console

  5. Tap in the Integrations tab

  6. Tap the Technical Accounts tab

  7. Tap Create new technical account button

  8. The Technical Account’s Service Credentials are initialized and displayed as JSON

AEM Developer Console - Integrations - Get Service Credentials

Once the AEM as Cloud Service environment’s Service Credentials have been initialized, other AEM developers in your Adobe IMS Org can download them.

Download Service Credentials

Download Service Credentials

Downloading the Service Credentials follows the similar steps as the initialization.

  1. Ensure you are logged in as a:

    • Adobe IMS Org’s Administrator
    • Member of the AEM Administrators IMS Product Profile on AEM Author
  2. Log in to Adobe Cloud Manager

  3. Open the Program containing the AEM as a Cloud Service environment to integrate with

  4. Tap the ellipsis next to the environment in the Environments section, and select Developer Console

  5. Tap in the Integrations tab

  6. Tap the Technical Accounts tab

  7. Expand the Technical Account to be used

  8. Expand the Private Key whose Service Credentials will be downloaded, and verify that the status is Active

  9. Tap on the > View associated with the Private Key, which displays the Service Credentials JSON

  10. Tap on the download button in the top-left corner to download the JSON file containing the Service Credentials value, and save the file to a safe location

Install the Service Credentials

The Service Credentials provide the details needed to generate a JWT, which is exchanged for an access token used to authenticate with AEM as a Cloud Service. The Service Credentials must be stored in a secure location accessible by the external applications, systems, or services that use it to access AEM. How and where the Service Credentials are managed are unique per customer.

For simplicity, this tutorial passes the Service Credentials in via the command line. However, work with your IT Security team to understand how to store and access these credentials in accordance with your organization’s security guidelines.

  1. Copy the downloaded the Service Credentials JSON to a file named service_token.json in the root of the project
    • Remember, never commit any credentials to Git!

Use Service Credentials

The Service Credentials, a fully formed JSON object, are not the same as the JWT nor the access token. Instead the Service Credentials (which contain a private key), are used to generate a JWT, which is exchanged with Adobe IMS APIs for an access token.

Service Credentials - External Application

  1. Download the Service Credentials from AEM Developer Console to a secure location
  2. The External Application needs to programmatically interact with AEM as a Cloud Service environment
  3. The External Application reads in the Service Credentials from a secure location
  4. The External Application uses information from the Service Credentials to construct a JWT Token
  5. The JWT Token is sent to Adobe IMS to exchange for an access token
  6. Adobe IMS returns an access token that can be used to access AEM as a Cloud Service
    • Access tokens can not change an expiry time.
  7. The External Application makes HTTP requests to AEM as a Cloud Service, adding the access token as a Bearer token to the HTTP requests’ Authorization header
  8. AEM as a Cloud Service receives the HTTP request, authenticates the request, and performs the work requested by the HTTP request, and returns an HTTP response back to the External Application

Updates to the External Application

To access AEM as a Cloud Service using the Service Credentials, the external application must be updated in three ways:

  1. Read in the Service Credentials
  • For simplicity, the Service Credentials are read from the downloaded JSON file, however in real-use scenarios, Service Credentials must be securely stored in accordance to your organization’s security guidelines
  1. Generate a JWT from the Service Credentials
  2. Exchange the JWT for an access token
  • When Service Credentials are present, the external application uses this access token instead of the Local Development Access Token, when accessing AEM as a Cloud Service

In this tutorial, Adobe’s @adobe/jwt-auth npm module is used to both, (1) generate the JWT from the Service Credentials, and (2) exchange it for an access token, in a single function call. If your application is not JavaScript based, please review the sample code in other languages for how to create a JWT from the Service Credentials, and exchange it for an access token with Adobe IMS.