Unauthorized purge error when configuring purge cache keys in AEM as a Cloud Service

This article addresses the Unauthorized Purge. Please contact Customer Support to obtain a PURGE key error encountered when configuring purge cache keys in Adobe Experience Manager (AEM) as a Cloud Service. The issue typically stems from incorrect cdn.yaml configuration or the simultaneous use of multiple purge keys, and can be resolved by using a single active key.

Description description

Environment

Adobe Experience Manager (AEM) as a Cloud Service – Sites

Issue/Symptoms

  • When configuring purge cache keys in the cdn.yaml file, the following error appears during cache purge attempts:
{"status": "error", "reason": "Unauthorized Purge. Please contact Customer Support to obtain a PURGE key."}
  • It occurs even after successfully deploying the configuration pipeline and setting secret-type keys as environment variables.

Resolution resolution

To resolve this issue, follow these steps:

  1. Ensure only one purge key is configured in your cdn.yaml file by removing all others (for example, keep only purgeKey1); reserve the second key (for example, purgeKey2) for future secret rotation without disrupting functionality.

  2. Verify that only one secret-type environment variable (CDN_PURGEKEY_A or CDN_PURGEKEY_B) is set in Cloud Manager for the active purge key and remove any others to prevent conflicts.

  3. Redeploy your configuration pipeline through Cloud Manager after modifying the cdn.yaml file and updating the environment variables to apply the changes.

  4. Test cache purging by running the following curl command with the active purge key:

    code language-none
    curl -X PURGE https://<your-publish-instance-url> \
    -H "X-AEM-Purge-Key: <value>" \
    -H "X-AEM-Purge: hard"
    
  5. Replace <your-publish-instance-url> with your publish instance URL and <value> with the active purge key.

  6. Rotate secrets when needed by following Adobe’s official documentation on rotating secrets and ensure only one active key is used at a time to avoid conflicts.

By following these steps, you can resolve unauthorized purge errors and enable cache purging functionality in your AEM as a Cloud Service environment effectively.

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