AEM as a Cloud Service: 401 Unauthorized Error on JSON2HTML worker config endpoint due to authentication token

This article explains how to resolve a 401 Unauthorized error when accessing the JSON2HTML worker config endpoint for Edge Delivery Services in Adobe Experience Manager as a Cloud Service.

Description description

Environment


Adobe Experience Manager as a Cloud Service (all versions)

Issue/Symptoms


When attempting to access the JSON2HTML worker config endpoint as described in the Adobe documentation for Edge Delivery Services, the following error occurs:

HTTP 401 Unauthorized
Authentication Token Required

Attempts to use the standard AEM Admin API token result in the same error. The issue occurs specifically when following Step 4 of the Publishing AEM Content Fragments to Edge Delivery Services documentation and accessing a URL similar to:

https://json2html.adobeaem.workers.dev/config/<tenant>/<project>/<branch>
  • The endpoint doesn’t accept the standard AEM Admin API token.
  • The error message indicates that an authentication token is required.
  • The request may have used the wrong header key or value format for the token.

Resolution resolution

  1. Ensure you are using the correct authentication header:

    • The header key must be Authorization.
    • The value must be in the format: token <your-token> (replace <your-token> with the actual token value).
  2. Don’t use the standard AEM Admin API token, as it isn’t valid for this endpoint.

  3. Obtain the required token for the JSON2HTML worker config endpoint:

    • Refer to the official Adobe documentation JSON2HTML for Edge Delivery Services for instructions on generating or retrieving the correct token for your environment.
    • If documentation is unclear, or you don’t have access to the required token, contact your Adobe administrator or support representative for assistance.
  4. Update your API request to include the correct Authorization header and token value.

  5. Retry accessing the endpoint. If the issue persists, verify that the token hasn’t expired and that you have the necessary permissions for the requested resource.

Cause

The 401 Unauthorized error occurs because the endpoint requires a specific authentication token in the Authorization header, and the standard AEM Admin API token isn’t accepted.

recommendation-more-help
experience-cloud-kcs-help-kbarticles