Step 1: Open a terminal
Open a terminal or command prompt and navigate to the directory where you want to clone the repository.
Step 2: Clone the repository
Run the following command:
Step 3: Navigate to the repository
The repository contains the following directories:
| Directory | Description |
|---|---|
ui.apps | Embed PDF component, authoring dialog, and client library |
ui.frontend | JavaScript and SCSS source files |
core | IC PDF Generation Servlet, PDF Data Merge Servlet, and OAuth Token Service |
ui.config | OSGi configurations for the supporting services |
Next Steps
After cloning the repository, integrate the required source files into your existing AEM project.
Update the Java package names, servlet paths, and environment-specific configurations to match your AEM environment.
Build and deploy the updated AEM project using your existing Adobe Cloud Manager pipeline.
Configure OAuth Authentication for Interactive Communications
If you plan to use the Embed PDF component to display PDFs generated through AEM Forms Interactive Communications (IC), you must configure OAuth Server-to-Server authentication.
The sample implementation includes an OAuthTokenService that automatically obtains, caches, and renews OAuth access tokens required to invoke the AEM Communications API.
Step 1: Obtain OAuth Credentials
-
Open the Adobe Developer Console.
-
Select the project containing your AEM OAuth Server-to-Server credentials.
-
Locate the following values:
- Client ID
- Client Secret
- OAuth Scopes
Step 2: Configure Cloud Manager Environment Variables
- Sign in to Adobe Cloud Manager.
- Open your AEM program.
- Navigate to Environments and select the target environment.
- Open Environment Variables.
- Create the following variables:
| Variable Name | Type | Service |
|---|---|---|
IC_OAUTH_CLIENT_ID | Standard | Publish |
IC_OAUTH_SCOPES | Standard | Publish |
IC_OAUTH_CLIENT_SECRET | Secret | Publish |
Use the OAuth credentials obtained from Adobe Developer Console.
Note: If your IC generation servlet runs on Author instead of Publish, configure these variables for the Author service.
Step 3: Verify the OSGi Configuration
The GitHub repository includes an example OAuthTokenService.cfg.json containing:
AEM resolves these values from the Cloud Manager environment configuration at runtime.
The OAuthTokenService uses these credentials to obtain access tokens from Adobe IMS. Tokens are cached and renewed automatically before expiration.
Step 4: Allowlist the OAuth Client ID
The OAuth Client ID must be allowlisted in AEM as a Cloud Service before it can invoke the Interactive Communications API.
This configuration is deployed using an Adobe Cloud Manager Configuration Pipeline.
Create the API Allowlist Configuration
In your existing AEM project’s Git repository, create a directory named config at the repository root.
Create a file named api.yaml inside this directory.
File location:
<your-aem-project>/
└── config/
└── api.yaml
Add the following configuration to api.yaml:
Replace YOUR_OAUTH_CLIENT_ID with the OAuth Client ID from Adobe Developer Console.
The example configuration applies to Development environments and allowlists the Client ID for both Author and Publish.
Adjust envTypes and the Author/Publish entries according to your deployment requirements.
Deploy the Configuration
-
Commit
config/api.yamlto your AEM project’s Git repository. -
Open Adobe Cloud Manager.
-
Navigate to Pipelines.
-
Create or edit a Configuration Pipeline.
-
Configure the pipeline with the following settings:
-
Setting Value Deployment Type Targeted Deployment Include Config Environment Your target AEM environment Git Repository Your AEM project repository Git Branch Branch containing api.yamlCode Location /config -
Save and run the Configuration Pipeline.
-
Verify that the pipeline completes successfully.
api.yaml file must be placed in the directory specified by the Configuration Pipeline’s Code Location. If the file is stored at the repository root under config/api.yaml, set Code Location to /config.After successful deployment, the configured OAuth Client ID is allowlisted for the specified AEM service tiers.
The technical account associated with the OAuth credentials must also have the permissions required to invoke the AEM Communications API.
ui.config. It is deployed through a Configuration Pipeline rather than the Full Stack pipeline.Step 5: Configure the AEM Communications API Endpoint
Update IcPdfGenerationServlet.cfg.json with the URL of your AEM environment:
Replace YOUR_AEM_PUBLISH_HOST with the hostname of your AEM Publish environment.
Ensure that the servlet’s outbound hostname validation permits only your explicitly trusted AEM environment.
Configure Dispatcher for PDF Generation Endpoints
If the Embed PDF component is used on a published AEM page or Adaptive Form, ensure that the Dispatcher configuration permits HTTP POST requests to the PDF-generation servlet endpoints.
The sample implementation uses the following endpoints:
/bin/aem-forms-pdf-embed/generate-ic-pdf
/bin/aem-forms-pdf-embed/merge-pdf
Add narrowly scoped allow rules to the appropriate Dispatcher filter configuration if these endpoints are not already permitted.
For example:
Use rule identifiers appropriate to your existing Dispatcher configuration.
Deploy the Dispatcher changes through your AEM Cloud Manager pipeline.
Security: Dispatcher rules control whether requests can reach the servlet. They do not provide user authentication or document-level authorization. Ensure that the PDF-generation servlets enforce the required access controls before allowing requests from publicly accessible pages.
Important Considerations
- Never store OAuth Client Secrets or access tokens directly in Java source code or GitHub.
- Store sensitive credentials using Cloud Manager secrets.
- Ensure the OAuth Client ID matches the credentials configured in Adobe Developer Console and the deployed API allowlist.
- The
OAuthTokenServicehandles access-token acquisition, caching, and proactive renewal automatically. - Ensure the technical account has the required AEM Forms permissions.
- Protect the IC generation servlet with appropriate authorization controls, particularly when serving customer-specific documents on anonymous Publish pages.
More help on this topic
Was this content helpful?
Announcements
Get hands-on with agentic AI.
Explore how AI agents work together through real examples and hands-on practice. Join your local User Group to design an agent workflow with your peers and leave with a practical framework you can apply to your own work.
Find an eventAdobe Experience Manager Roadmap Webinar, Part 2 (Forms, Cloud & Managed Services) - Americas & EMEA
Preview the AEM Forms, Cloud, and Managed Services roadmap. Ask the team live.
Adobe Experience Manager Roadmap Webinar, Part 2 (Forms, Cloud & Managed Services) - Americas & APAC
Preview the AEM Forms, Cloud, and Managed Services roadmap. Ask the team live.