> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gradial.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up the AEM integration in Gradial

> The Gradial-side steps for the classic AEM connection: choose an authentication method, add the integration, set the workflow and content paths, and optionally enable per-user AEM sign-in.

## Overview

The classic AEM connection has two halves:

1. **The AEM side.** Create the credential or install the package that lets Gradial in. This differs by AEM type and is covered in the method guides:
   * [AEM as a Cloud Service](https://docs.gradial.com/docs/integrations-administration-and-setup/integrations/aem/aem-cloud.md)
   * [AEM 6.5 / LTS (on-premise or Adobe Managed Services)](https://docs.gradial.com/docs/integrations-administration-and-setup/integrations/aem/aem-on-prem.md)
   * [AEM OpenAPI](https://docs.gradial.com/docs/integrations-administration-and-setup/integrations/aem/aem-openapi.md) (AEM as a Cloud Service, has its own integration dialog)
   * [Edge Delivery Services](https://docs.gradial.com/docs/integrations-administration-and-setup/integrations/aem/aem-edge-delivery.md) and [AEM Guides](https://docs.gradial.com/docs/integrations-administration-and-setup/integrations/aem/aem-guides.md)
2. **The Gradial side.** Add the integration in Gradial. This page covers it once for the classic wizard: classic AEM (Cloud Service, 6.5, LTS and AMS) and Edge Delivery Services sites that are authored in AEM. Only the authentication method and credential fields change between them.

> [!NOTE]
>
> The **AEM OpenAPI** integration uses its own dialog. Use this page for its surrounding concepts (environments, workspaces, IP allowlist), and the [AEM OpenAPI guide](https://docs.gradial.com/docs/integrations-administration-and-setup/integrations/aem/aem-openapi.md#add-the-integration-in-gradial) for its fields.

> [!NOTE]
>
> Edge Delivery Services sites authored in Document Authoring (da.live) do not use this wizard. They have their own **Edge Delivery Services** dialog, which is available only to organizations that have it enabled and allows one Edge Delivery Services site per organization. See [Edge Delivery Services](https://docs.gradial.com/docs/integrations-administration-and-setup/integrations/aem/aem-edge-delivery.md).

## Choose an authentication method

The wizard lists seven authentication methods for every AEM type, and only some work for each type. Pick the option shown here for your AEM type. The labels below are the labels in the wizard.

| AEM type | Wizard option to pick | Notes |
| :- | :- | :- |
| **AEM as a Cloud Service** | **OAuth server-to-server for AEM as a Cloud Service** | Paste the credential JSON that you saved from the target environment's **AEM Developer Console**. See [Which option, step by step](#which-option-step-by-step). |
| **AEM as a Cloud Service**, no JSON available | **Adobe IMS server-to-server** | A second valid path. You enter the **Client ID** and **Client secret** by hand and Gradial uses a fixed Adobe IMS endpoint. See [Credential fields](#add-the-integration-in-gradial). |
| **AEM as a Cloud Service**, existing JWT credential | **Adobe IMS technical account** | For a JWT credential file that already exists. The other Cloud cards reject a JWT file. See [JWT service credentials status](#jwt-service-credentials-status). |
| **AEM 6.5 or LTS, on-premise or AMS**, author configured to validate Adobe IMS tokens | **Adobe IMS server-to-server** | Needs a bearer authentication handler on the author that accepts the client ID. See [Adobe IMS server-to-server setup](https://docs.gradial.com/docs/integrations-administration-and-setup/integrations/aem/aem-on-prem.md#adobe-ims-server-to-server-setup). |
| **AEM 6.5 or LTS, on-premise or AMS**, Granite OAuth server active and permitted | **OAuth 2.0 JWT bearer** | Uses the author's Granite OAuth server: the **Client ID**, **Client secret** and the `.p12` file from **Download Private Key**. |
| **AEM 6.5 or LTS, on-premise or AMS**, local account permitted | **Basic authentication** | A local username and password over HTTPS. See [Basic authentication over HTTPS](#basic-authentication-over-https). |
| **AEM as a Cloud Service**, Content Fragment, Launch, folder, asset and page APIs | [AEM OpenAPI](https://docs.gradial.com/docs/integrations-administration-and-setup/integrations/aem/aem-openapi.md) integration | A separate integration with its own dialog. It covers a subset of what the classic integration does, so uploads and other classic operations still need a classic integration for the same author, and page previews normally do too. See [Capability boundaries](https://docs.gradial.com/docs/integrations-administration-and-setup/integrations/aem/aem-openapi.md#capability-boundaries). |
| **Per-user sign-in**, AEM 6.5, LTS or AEM as a Cloud Service | **Connect AEM** | Layered on the connection's own credentials. Needs the Gradial OBO bundle on the AEM Author. See [Per-user AEM sign-in](#per-user-aem-sign-in-connect-aem). |

Adobe Managed Services (AMS) is hosted AEM 6.5 or LTS, so use the 6.5 / LTS rows. Do not send an AMS author to the Cloud Service steps to create its account. Which of the 6.5 / LTS methods works depends on how your author is configured, and any one of them can work when its prerequisites are in place. The first one in a list is not mandatory.

> [!WARNING]
>
> **OAuth 2.0 client credentials** asks for a token URL and needs an issuer that accepts the client credentials grant. AEM's Granite OAuth server (`/oauth/token`) does not support that grant, so do not use this card against Granite. Use **OAuth 2.0 JWT bearer** for Granite. A custom OAuth issuer that does accept the grant is a separate case that this page does not cover.

> [!NOTE]
>
> The wizard shows a **Recommended** badge. When the author URL host ends in `.adobeaemcloud.com`, the badge is on **OAuth server-to-server for AEM as a Cloud Service**. For any other URL (AEM 6.5, LTS, on-premise, a custom vanity domain in front of Cloud Service, or no URL entered yet) the badge stays on **Adobe IMS technical account**. Follow the table above instead of the badge. If your Cloud Service author uses a vanity domain, pick **OAuth server-to-server for AEM as a Cloud Service** yourself.

### JWT service credentials status

Adobe has deprecated Service Account (JWT) credentials in favor of OAuth Server-to-Server credentials. Adobe's pages describe the status as follows:

* Adobe's [Developer Console migration guide](https://developer.adobe.com/developer-console/docs/guides/authentication/ServerToServerAuthentication/migration) lists the deprecation timeline and the migration steps.
* Adobe's [AEM as a Cloud Service JWT reference](https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/developing/generating-access-tokens-for-server-side-apis-jwt-legacy) is a reference for existing JWT-based integrations.
* Adobe's [JWT-to-OAuth migration for AEM](https://experienceleague.adobe.com/en/docs/experience-manager-learn/foundation/authentication/jwt-to-oauth-migration) and [knowledge base article](https://experienceleague.adobe.com/en/docs/experience-cloud-kcs/kbarticles/ka-35966) cover migrating AEM integrations.

Gradial can read and sign with an existing AEM-issued JWT credential JSON through **Adobe IMS technical account**. That does not establish that Adobe will let your organization issue a new JWT credential today. To migrate, create the replacement account with the current AEM console guide in [AEM as a Cloud Service](#which-option-step-by-step), then check that the replacement account has the product profiles and AEM permissions the old account had. You can add the new credential in Gradial and test it before you remove the old one.

## Which option, step by step

> [tab] AEM as a Cloud Service
>
> 1. Open the target environment's **AEM Developer Console**: in [Adobe Cloud Manager](https://my.cloudmanager.adobe.com/), select the program, find the environment, select the ellipsis (...), then select **Developer Console**.
>
> 2. Go to **Integrations**, then select **Create new technical account** and choose **OAuth Server-to-Server (S2S)**.
>
> 3. Save the credential JSON when the console shows the client secret. The secret appears only then. The console's later **View** response contains a secret ID, which cannot replace the secret.
>
> 4. In Adobe Admin Console, assign the technical account (its `@techacct.adobe.com` email) to an AEM as a Cloud Service product profile with **Add User**, and allow time for it to propagate.
>
> 5. In Gradial, pick **OAuth server-to-server for AEM as a Cloud Service** and paste the saved JSON.
>
> 6. After the first authenticated request, the technical account appears in AEM as a user ending in `@techacct.adobe.com`. Add it, or its synchronized product-profile group, to the groups that grant the access Gradial needs. See [permissions](https://docs.gradial.com/docs/integrations-administration-and-setup/integrations/aem/aem-cloud.md).
>
> > [!WARNING]
> >
> > Creating the account needs an Adobe IMS organization administrator who is also a member of either **AEM Users** or **AEM Administrators** on the target author. A product-profile Developer role alone is not enough. If you cannot create the account, see [Troubleshooting](#troubleshooting).
>
> The Adobe Developer Console project and API-product steps do not apply to this card. They belong to other Adobe integrations, such as AEM Guides publishing.
>
> > [!NOTE]
> >
> > The Granite OAuth server bundle (`com.adobe.granite.oauth.server`) and the Gradial installation package **do not apply** to AEM as a Cloud Service. They are for AEM 6.5 and LTS only.

> [tab] AEM 6.5 / LTS (on-premise or AMS)
>
> Choose the method your author is configured for. Any one of them works when its prerequisites are met.
>
> * **Adobe IMS server-to-server**, where the author validates Adobe IMS tokens. Create an OAuth Server-to-Server credential in Adobe Developer Console, and have your AEM administrator allowlist its client ID in AEM's bearer authentication handler. AEM rejects a token from a client ID that isn't on the list with HTTP 401. After the first allowlisted request, AEM creates a synced user with an ID ending in `@techacct.adobe.com`, and its rights come from the groups you add it to. Follow [Adobe IMS server-to-server setup](https://docs.gradial.com/docs/integrations-administration-and-setup/integrations/aem/aem-on-prem.md#adobe-ims-server-to-server-setup) for the credential, the four AEM configurations, a token check and the groups.
> * **OAuth 2.0 JWT bearer**, where the Granite OAuth server is installed, active and permitted. Set up the server, client and scopes as described in the [AEM 6.5 / LTS guide](https://docs.gradial.com/docs/integrations-administration-and-setup/integrations/aem/aem-on-prem.md).
> * **Basic authentication**, where a local account is permitted. See [Basic authentication over HTTPS](#basic-authentication-over-https).
>
> #### Check the OAuth server bundle
>
> 1. Open `<AEM-HOST>:<PORT>/system/console/bundles` on the author.
>
> 2. Search for `oauth.server`.
>
> 3. Confirm the bundle `com.adobe.granite.oauth.server` is present and **Active**. You can also check `/system/console/components` for `OAuth2ServerAuthenticationHandler`.
>
> > [!NOTE]
> >
> > Adobe lists support for `com.adobe.granite.oauth.server` as deprecated in AEM 6.5 LTS, with Adobe IMS integration as its replacement (see Adobe's [AEM 6.5 LTS release notes](https://experienceleague.adobe.com/en/docs/experience-manager-65-lts/content/release-notes/release-notes)). The handler is labeled **DEPRECATED** in the Web Console. Whether the bundle is installed and active depends on your installation, so check it as above.
>
> If it is missing or not active, use **Adobe IMS server-to-server** if your AEM validates Adobe IMS tokens, or **Basic authentication**.
>
> An AMS hosting label alone does not tell you which of these your author supports. Ask your AEM administrator or Adobe which bearer handler and authentication methods are configured. Do not choose **Adobe IMS technical account** (JWT) as a general fallback on AMS: it needs an issuer and bearer setup that you have confirmed.

## Add the integration in Gradial

Have your credentials ready from the AEM-side guide for your method. Then:

**1. Open Integrations**

In Gradial, go to **Settings** and select **Integrations**, then add a new AEM integration.

**2. Connection**

Enter:

* **Integration name**: a name for this integration, for example `Production AEM`.
* **AEM author instance URL**: for example `https://author.example.com`.
* **Integration scope**: **Sites & assets**, **Sites only** or **Assets only**.
* **Credential setup**: **Single credential set** or **Separate credentials**. **Separate credentials** is available only when the scope is **Sites & assets**. It asks for a second author URL and a second credential for DAM (assets). **Sites only** and **Assets only** use a single credential set.
* **Authentication method**: pick the option for your AEM type from the table above.

Network settings (proxy, mutual TLS) and resilience settings (read and write rate limits) are optional. See [Advanced configurations](https://docs.gradial.com/docs/integrations-administration-and-setup/integrations/aem/advanced-configurations.md).

**3. Credentials**

Enter the credentials for the method you picked.

> [tab] OAuth server-to-server for AEM as a Cloud Service
>
> Paste the credential JSON saved from the AEM Developer Console. It must contain an `imsEndpoint` host (for example `ims-na1.adobelogin.com`), a nonempty `scopes` array and a `technicalAccount` with a `clientId` and `clientSecret`. Gradial requests tokens from `https://<imsEndpoint>/ims/token/v3` with the scopes in the file. If the JSON has no client secret, or is the console's **View** response, the wizard says so. If it is a JWT file, the wizard tells you to use **Adobe IMS technical account** instead.

> [tab] Adobe IMS technical account
>
> Paste the JSON of an existing JWT credential, exactly as downloaded. Do not edit it.

> [tab] Adobe IMS server-to-server
>
> Enter the **Client ID** and **Client secret** of the OAuth Server-to-Server credential. Gradial requests tokens from Adobe IMS at `https://ims-na1.adobelogin.com/ims/token/v3` with the `openid`, `AdobeID` and `read_organizations` scopes. For an author URL whose host ends in `.adobeaemcloud.com`, it also requests `additional_info.projectedProductContext`. A custom vanity domain does not trigger that rule. You enter no token URL or scopes. Gradial renews the token when it expires, using the lifetime that Adobe IMS returns.

> [tab] OAuth 2.0 JWT bearer
>
> For AEM 6.5 and LTS. Enter the **Client ID**, **Client secret**, upload the **P12 certificate** (the `.p12` from AEM's **Download Private Key**) with its **P12 password**. The P12 and its password must match the client. Optionally enter OAuth scopes (`read_all`, `site_author`, `upload_assets` and the others in the [scope table](https://docs.gradial.com/docs/integrations-administration-and-setup/integrations/aem/aem-on-prem.md)). Gradial uses `<AEM-HOST>/oauth/token` and always adds the `profile` and `offline_access` scopes.

> [tab] OAuth 2.0 client credentials
>
> Asks for a **Client ID**, **Client secret**, a **token URL** and optional scopes. It needs an issuer that accepts the client credentials grant. AEM's Granite OAuth server does not, so do not use it against Granite. Use **OAuth 2.0 JWT bearer** instead.

> [tab] OAuth 2.0 authorization code
>
> Enter the **Client ID**, **Client secret**, **Redirect URL** and **Refresh token**, and optionally the OAuth scopes. This needs an OAuth client already configured on the author and a valid refresh token issued with offline access. Gradial derives `<AEM-HOST>/oauth/authorize` and `<AEM-HOST>/oauth/token` and always adds the `profile` and `offline_access` scopes.

> [tab] Basic authentication
>
> Enter the **Username** and **Password** of the AEM service user. See [Basic authentication over HTTPS](#basic-authentication-over-https).

Select **Next**. Gradial validates the connection before moving on. The check reads `/libs` with the Sites scope, and reads `/apps` if the first read errors. It also performs other checks, including a read of the DAM metadata schemas with the Assets scope. Passing these checks does not prove that every site or DAM you map later can be written to. If validation fails, fix the credentials or AEM permissions before continuing.

**4. Workflow**

Choose **Launch workflow** (for pages and experience fragments, changes go to an AEM Launch that is reviewed and promoted, and for classic Content Fragments they go to a variation) or **Direct edit** (changes are made to the author content directly). Neither choice publishes. Saving a Direct edit change does not publish it, and promoting a Launch does not publish it. Publishing is a separate, authorized action. See [AEM Launches](https://docs.gradial.com/docs/integrations-administration-and-setup/integrations/aem/aem-launches.md).

**5. Content paths**

Add a content path mapping. The **Site path** field appears when the scope is **Sites only** or **Sites & assets**. The **DAM path** field appears when the scope is **Assets only** or **Sites & assets**. A default **template** is optional. Gradial checks each path against AEM when you leave the field. In some configurations the check can only confirm the format of the path, and the form says so. A format-only result does not confirm that the path exists. Finish the wizard.

**6. Validate permissions**

Open the integration, go to the **Permissions** tab and run the permission tests. See [AEM Launches](https://docs.gradial.com/docs/integrations-administration-and-setup/integrations/aem/aem-launches.md) for the Launch test.

**7. Configure live URL domain mapping**

Map your AEM paths to the live domain used for previews and links.

**8. Add the integration to an Environment and Workspace**

Create an **Environment** (a combination of integrations), then add the Environment to a **Workspace**.

### Connectivity and the IP allowlist

If your AEM author restricts inbound traffic by IP address, allowlist Gradial's egress addresses before you validate. See [IP allowlisting](https://docs.gradial.com/docs/integrations-administration-and-setup/ip-allowlist.md). AEM as a Cloud Service author is reachable from the public internet by default, subject to authentication, so it needs this only if you have restricted it. On-premise and AMS authors need it only if the author or a load balancer in front of it filters by IP.

## What differs by AEM type

| Area | AEM as a Cloud Service | AEM 6.5 / LTS (on-premise or AMS) |
| :- | :- | :- |
| Credentials come from | The environment's **AEM Developer Console** | AEM itself (Granite OAuth server, local users) or Adobe IMS, depending on how the author is configured |
| Wizard option | **OAuth server-to-server for AEM as a Cloud Service**; or **Adobe IMS server-to-server** by hand; or **Adobe IMS technical account** for an existing JWT file | **Adobe IMS server-to-server**, **OAuth 2.0 JWT bearer** or **Basic authentication**, depending on the author's configuration |
| Permissions come from | The AEM groups of the synced `@techacct.adobe.com` user, once it has authenticated | With **Adobe IMS server-to-server**: the effective AEM privileges of the synced user, including its groups. With **OAuth 2.0 JWT bearer**: the installed Granite OAuth scopes, which are separate from user groups. With **Basic authentication**: the ACLs of the local user |
| Per-user sign-in | **Connect AEM**, with the `gradial.obo` bundle and its configurations deployed through Cloud Manager | **Connect AEM**, with `gradial.all-1.3.0.zip` installed in Package Manager plus one OSGi configuration |
| IP allowlist | Only if you restricted inbound IPs | Only if the author or its load balancer filters by IP |

The scope selection, workflow, content paths, permission tests, Environments and Workspaces work the same way for each of these.

## Basic authentication over HTTPS

Basic authentication is available in the wizard for every AEM type. For AEM 6.5, LTS and AMS it is a supported fallback when OAuth credentials are not available. It is a viable option when you follow these practices:

* **Use HTTPS only.** Serve the author over HTTPS and enable HSTS. Never send basic credentials over plain HTTP.
* **Use a long random secret.** Generate a random password of 32 to 40 characters for a dedicated service user. Store it in a secrets manager, not in a wiki or ticket.
* **Scrub the `Authorization` header from logs** on your load balancer, dispatcher, proxy and WAF.
* **Rotate the credential** on a schedule, and immediately if it may have been exposed. Update it in Gradial after each rotation.
* **Restrict who can use it.** If you filter inbound traffic by IP, allowlist [Gradial's egress IP addresses](https://docs.gradial.com/docs/integrations-administration-and-setup/ip-allowlist.md), and consider rate limiting the service user.
* **Give the service user the least privilege** it needs, using the same paths as in the [permissions table](https://docs.gradial.com/docs/integrations-administration-and-setup/integrations/aem/aem-cloud.md).

> [!NOTE]
>
> On AEM as a Cloud Service, use **OAuth server-to-server for AEM as a Cloud Service** for production. Basic authentication on Cloud Service works only with a local Cloud Service user that has been provisioned for it (Adobe documents it for a specific use case in its [programmatic asset upload example](https://experienceleague.adobe.com/en/docs/experience-manager-learn/assets/developer/programmatic-asset-upload)). It will not work on an author that accepts only Adobe IMS.

## Per-user AEM sign-in (Connect AEM)

**Access:** Must be enabled for your organization. Contact your Gradial team to get access.

Per-user sign-in lets each person connect their own AEM account. Tasks they start in Gradial then run with their own AEM permissions, and AEM records them as the author instead of the shared service account.

> [!WARNING]
>
> Per-user sign-in needs the Gradial OBO bundle (`io.github.gradial:gradial.obo` 1.3.0) on the AEM Author. It is for AEM 6.5 (SP8 or later), LTS and AEM as a Cloud Service, on Author only. Cloud Service is not verified end to end (see the install page). See [Install the Gradial OBO package](https://docs.gradial.com/docs/integrations-administration-and-setup/integrations/aem/aem-obo-install.md).

### What it does

* Each person connects their own AEM account once, using **Connect AEM**.
* Tasks that person starts run with their AEM permissions. A change the person isn't allowed to make in AEM is refused.
* AEM shows that person as the user who made the change.
* Previews and thumbnails still load with the connection's service account.
* It applies to every AEM integration that shares the connection.

### Before you start

* Your AEM administrator has [installed and configured the Gradial OBO package](https://docs.gradial.com/docs/integrations-administration-and-setup/integrations/aem/aem-obo-install.md) on the AEM Author. They give you an **OBO client ID** and **OBO client secret**.
* Your AEM administrator allows the Gradial callback URL for the OBO client. Copy it from the **Per-user AEM sign-in** form in Gradial. It ends in `/api/integrations/aem-obo/callback`.
* The connection's AEM author URL uses HTTPS and has no embedded credentials.
* Sites and Assets use the same Author. If the connection has a separate Assets instance URL, remove it or set it to the author instance URL.
* Gradial refuses to enable it on a shared connection if a linked integration belongs to another organization, is not a classic AEM integration, or has **Act as the initiating user** turned on.
* You are an owner or admin of your Gradial organization.

### Admin steps in Gradial

**1. Open the integration**

Go to **Settings -> Integrations** and open the AEM integration. The **Per-user AEM sign-in** section is at the top of the **General** tab.

**2. Enter the sign-in settings**

* **AEM sign-in origin**: the author URL people sign in to. It can differ from the integration's proxy URL.
* **OBO client ID** and **OBO client secret**: from the OBO package. The secret must be at least 20 characters.

**3. Enable it**

Select **Enable per-user sign-in**. To change the settings later, select **Update sign-in settings** and **Save sign-in settings**. People must reconnect after the settings change.

You can also turn it on while you add the integration: in the wizard's **Content paths** step, switch on **Per-user AEM sign-in** and fill in the same fields. Each person still connects AEM from the integration's settings afterwards.

To turn it off, select **Turn off per-user sign-in**. Tasks then use the connection's service account again, and every person's AEM connection is removed.

### Steps for each person

**1. Connect AEM**

Go to **Settings -> Integrations**, open the integration and select **Connect AEM**. Allow popups. Sign in to AEM in the window that opens. When it finishes, the status reads **Your AEM account is connected.**

**2. Reconnect when asked**

If the status reads **Your AEM account needs to be reconnected**, or a Task asks you to, select **Reconnect AEM**.

**3. Disconnect**

Select **Disconnect my AEM account**. If AEM couldn't confirm that the grant was revoked, Gradial tells you to ask your AEM administrator to revoke it.

### If someone hasn't connected

Their Tasks on that integration are refused, and Gradial shows **Connect your AEM account in Settings > Integrations to continue.** If the stored authorization no longer works, it shows **Reconnect your AEM account in Settings > Integrations to continue.** Nothing runs with the service account instead. A person can't steer another person's Task.

## Troubleshooting

### Can't create the OAuth credential on AEM as a Cloud Service

Creating an OAuth Server-to-Server technical account in the AEM Developer Console needs an **Adobe IMS organization administrator** who is also a member of **AEM Users** or **AEM Administrators** on the target author. Either profile qualifies together with the administrator role. A product-profile Developer role alone does not.

* Ask your IMS organization administrator to create the account, or to add the missing profile membership.
* If you only have an existing JWT credential, use **Adobe IMS technical account** with that file, and plan the migration described in [JWT service credentials status](#jwt-service-credentials-status).
* If it still doesn't work, contact your Gradial representative.

### Validation fails on Next

Check the credential values, that the author URL is reachable from Gradial (see the [IP allowlist](https://docs.gradial.com/docs/integrations-administration-and-setup/ip-allowlist.md)), and that the service user or technical account has the permissions in the method guide. A denied path does not always mean a bad credential: the same credential can pass the identity check and still lack rights on a given content path. If the problem continues, contact your Gradial representative.

## Need Help?

> [!NOTE]
>
> Contact your Gradial representative for additional support with your AEM integration.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.