Resolving nested Adobe I/O web action authorization issues in AEMaaCS

This article addresses the issue of calling an Adobe I/O web action from within another web action when authorization is required. The problem arises due to configuration constraints or missing authentication details. The solution involves adjusting configurations and ensuring proper authentication mechanisms are in place to enable successful nested calls.

Description description

Environment

Adobe Experience Manager as a Cloud Service (AEMaaCS) - Sites

Issue/Symptoms

When calling an Adobe I/O web action from within another web action, the nested call fails if authorization is required. This happens due to incorrect configuration settings or missing authentication details such as tokens and headers.

Resolution resolution

To resolve this issue, follow these steps:

  1. Check if the inner web action does not need to be publicly callable. If it does not change the configuration setting require-adobe-auth from true to false and set web to *no.*This makes it a purely worker action that can’t be accessed externally.
  2. If the inner web action must remain protected and requires Adobe authentication, ensure that the code calling this inner action includes proper authentication details.
  3. Include a valid JWT or OAuth token in the Authorization header as Bearer <token>. Also, add the header x-gw-ims-org-id with the correct IMS organization ID.
  4. Ensure that authentication tokens are correctly retrieved from Adobe I/O context and properly propagated during nested calls when making calls from AEM Servlets or front-end components.

For further information, explore the Adobe I/O Runtime action section of the AEM as a Cloud Service Tutorials.

recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f