Configuring Sitecore Content Hub DAM in SitecoreAI: a Practical Guide
A practical checklist for configuring the Content Hub DAM connector in SitecoreAI and telling CORS, CSP and X-Frame-Options errors apart.
Connecting Sitecore Content Hub DAM to SitecoreAI involves a few settings across both platforms. When the setup is incomplete, the connector may appear in one editing experience but fail in another. This guide covers the main configuration points and how to tell common browser errors apart.
1. Understand the two editing experiences
Content Hub DAM can be used from both Pages and the Content Editor. They may rely on the same SitecoreAI environment and DAM connection string, but the browser loads them in different contexts:
- Pages runs on the Sitecore Pages domain.
- The Content Editor runs on the SitecoreAI environment domain.
That distinction matters when configuring allowed origins and troubleshooting iframe errors. A setup working in Pages does not automatically prove that the Content Editor flow is configured correctly, or vice versa.
2. Configure the SitecoreAI Deploy variables
In SitecoreAI Deploy, add the DAM variables to the relevant environment and target them to CM:
| Variable | Purpose |
|---|---|
SITECORE_AppSettings_damEnabled__define | Enables the DAM integration |
Sitecore_ConnectionStrings_DAM_dot_ContentHub | Content Hub connection details |
Sitecore_ConnectionStrings_DAM_dot_SearchPage | DAM asset search page |
Sitecore_ConnectionStrings_DAM_dot_ExternalRedirectKey | Redirect key used by the connector |
The connection string follows this pattern:
ClientId=<client-id>;ClientSecret=<client-secret>;UserName=<technical-user>;Password=<password>;URI=https://<content-hub-host>/;Use the Content Hub hostname for URI, including https:// and the trailing slash. Check the spelling of every parameter and avoid unintended spaces, especially around = and ;.
Security note: store credentials as secrets and never include them in screenshots, logs, or public documentation.
After changing environment variables, follow the documented deployment procedure so the updated values are applied to CM.
3. Use a dedicated Content Hub user
The connection string authenticates to Content Hub as the configured user. That user needs the permissions required by the DAM connector and access to the relevant assets.
A dedicated technical user makes the integration easier to audit and maintain. Creating a user does not, by itself, configure browser access: user permissions, allowed origins, and iframe policies address different parts of the setup.
4. Configure CORS in Content Hub
Add the origins required by the editing experiences to Content Hub's CORS configuration. Depending on your setup, these may include:
https://pages.sitecorecloud.io
https://<sitecoreai-cm-host>Use the exact environment hostnames and the format required by your Content Hub configuration. Treat DEV, QA, and PROD separately: each environment may have a different CM hostname, and Pages may use different domains for production and staging.
CORS controls whether browser requests from an origin are allowed. It does not, by itself, authorize a site to display Content Hub inside an iframe.
5. Allow Content Hub in the Content Editor's CSP
The Content Editor's Content Security Policy must allow the Content Hub host in its frame-src directive. If the project applies CSP through a web.config transform, verify that the transform reaches the intended web.config and that it updates the existing header correctly.
For example, the relevant directive may need to include:
frame-src 'self' https://<content-hub-host>;Keep existing required frame sources when updating the policy. A transform using Replace only works when the matching header exists at the location targeted by the transform. Confirm the generated configuration after deployment rather than assuming the transform was applied.
6. Read the browser error before changing settings
These errors point to different controls:
| Browser message | What it usually indicates |
|---|---|
blocked by CORS policy | The request's origin or preflight request was not accepted |
violates ... frame-src | The parent page's CSP does not permit that frame source |
X-Frame-Options: deny | The framed response refuses to be embedded |
ERR_CONNECTION_REFUSED | The host could not be reached |
Unauthorized | Authentication, editing secret, or authorization may be failing |
A direct browser visit to a URL is not a complete test of an embedded flow. It does not reproduce the iframe's origin, preflight request, authentication, or response headers.
7. Troubleshoot in a controlled order
For each environment, verify:
- The DAM variables exist in SitecoreAI Deploy, have the correct values, and target CM.
- The connection string points to the intended Content Hub instance and uses a user with the required permissions.
- Content Hub CORS includes the relevant Pages and CM origins.
- The Content Editor CSP allows the Content Hub host in
frame-src. - The deployed CM configuration contains the expected CSP header.
- Pages and the Content Editor are tested separately, with the browser console and network response checked for the failing request.
Keep a simple environment matrix for DEV, QA, and PROD. Record each environment's CM hostname, Content Hub hostname, Pages origin, variable status, and test result. This helps catch configuration copied from QA into DEV or PROD without the corresponding hostname changes.
Final checklist
Conclusion
CORS, CSP, iframe response headers, and authentication are separate parts of the integration. Identifying which browser message appears is usually the fastest way to choose the right next check.
References