OAuth Server-to-Server Authentication

OAuth Server-to-Server Authentication allows secure, token-based access to AEM Forms Communications APIs without requiring user interaction. OAuth server-to-server authentication is supported by Adobe Developer Console.

Prerequisites

Before you begin, make sure the following prerequisites are met:

How to Generate an Access Token Using OAuth Server-to-Server Authentication?

Follow the steps below to generate an access token from the Adobe Developer console, and make your first API call through OAuth Server-to-Server Authentication.

1. Adobe Developer Console Project Setup

  1. Navigate to Adobe Developer Console

  2. Log in with your Adobe ID

  3. Create New Project or navigate to your existing project

To create a new project
  1. From the Quick Start section, click Create new project

  2. A new project is created with a default name

    Create ADC Project

  3. Click Edit project in the top right corner

    Edit Project

  4. Provide a meaningful name (e.g., “formsproject”)

  5. Click Save

    Edit Project Name

To navigate to your existing project
  1. Click All Projects from the Adobe Developer Console

    Search Projects

  2. Locate your project and click to open it.

    Locate Projects

2. Add Forms APIs

Add Forms APIs based on what you want to do:

  • AEM Forms Communications APIs: use when you need to generate, convert, assemble, or secure documents (PDF and related formats).
  • Adaptive Forms Runtime APIs – use when you need to render, submit, or process Adaptive Forms at runtime.
For AEM Forms Communications APIs
  1. Click Add API

    Add api

  2. Select Forms Communication APIs

    1. In the Add API dialog, filter by Experience Cloud

    2. Select “Forms Communication APIs”

      Add Forms Communication API

    3. Click Next

    4. Select OAuth Server-to-Server authentication method

      Select Authentication method

For Adaptive Forms Runtime APIs
  1. Click Add API

    Add api

  2. Select AEM Forms Delivery and Runtime API

    1. In the Add API dialog, filter by Experience Cloud

    2. Select “AEM Forms Delivery and Runtime API”
      Add Forms Communication API

    3. Click Next

    4. Select OAuth Server-to-Server authentication method.
      Select Authentication method

You can also add the API and authentication method to your existing project by clicking Add to Project > API
Add API to existing Project

3. Add Product Profile

Product profile provides permissions (or authorization) for credentials to access the AEM resources.

  1. Select the Product Profile that matches your AEM instance URL (https://Service Type -Environment Type-Program XXX-Environment XXX.adobeaemcloud.com).

    • Service Type – specifies services or permissions associated with the AEM instance

    • Environment Type – specifies whether the envrionment is for Author or Publish service

    • Program XXX – identifies the Cloud Manager program ID

    • Environment XXX – identifies the specific environment ID within that program

    note note
    NOTE
    Product profiles are tied to a specific AEM instance (program + environment). Always choose the profile that matches your instance URL.
  2. Click Save configured API. The API and Product Profile are added to your project

    Select Project Configuration

4. Generate and Save Credentials

  1. Navigate to your project in Adobe Developer Console

  2. Click OAuth Server-to-Server credential

  3. View the Credential details section

    View Credentials

Record API Credentials

    API Credentials:
    ================
    Client ID: <your_client_id>
    Client Secret: <your_client_secret>
    Technical Account ID: <tech_account_id>
    Organization ID: <org_id>
    Scopes: AdobeID,openid,read_organizations

5. Access Token Generation

Generate the Access token either manually or programmatically:

For Testing

Generate access tokens manually in Adobe Developer Console:

  1. Navigate to your Project

    1. In Adobe Developer Console, open your project
    2. Click OAuth Server-to-Server
  2. Generate Access Token

    1. Click the “Generate access token” button in your project’s API section
    2. Copy the generated access token

    Generate Access Token

    note note
    NOTE
    Access token is valid for only for 24 hours
For Production

Generate tokens programmatically using Adobe IMS API:

Required Credentials:

  • Client ID
  • Client Secret
  • Scopes (typically: openid, AdobeID, read_organizations, additional_info.projectedProductContext, read_pc.dma_aem_cloud, aem.document)

Token Endpoint:

code language-none
https://ims-na1.adobelogin.com/ims/token/v3

Sample Request (curl):

code language-bash
curl -X POST 'https://ims-na1.adobelogin.com/ims/token/v3' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'grant_type=client_credentials' \
-d 'client_id=<YOUR_CLIENT_ID>' \
-d 'client_secret=<YOUR_CLIENT_SECRET>' \
-d 'scope=AdobeID,openid,read_organizations'

Response:

code language-json
    {
    "access_token": "eyJhbGciOiJSUz...",
    "token_type": "bearer",
    "expires_in": 86399
    }

You can now use the generated access token to make API call for development, stage, or production environments.

Best practices: Managing credentials for Development, Staging, and Production

  • Always use separate credentials for Development, Staging, and Production.

  • Map each credential to the correct AEM environment URL.

  • Store secrets securely and never commit them to source control.

  • Track access token validity, as tokens are valid for 24 hours only.

Next Steps

To learn how to set up environment for Synchronous Forms Communication APIs, see AEM Forms as a Cloud Service Communications Synchronous Processing.

Learn how to set environment for Synchronous (On-Demand) and Asynchronous (Batch) Forms Communications APIs:

Synchronous APIs

AEM Forms Communications APIs - Synchronous

Learn how to set up environment for Synchronous (on-demand) Forms Communications APIs that generate or process documents instantly.

Learn more

Asynchronous APIs

AEM Forms Communications APIs - Asynchronous (Batch)

Learn how to set up environment for Asynchronous (Batch) Forms Communications APIs that generate or process multiple documents in a scheduled manner.

Learn more

recommendation-more-help
fbcff2a9-b6fe-4574-b04a-21e75df764ab