Configure the DAM connector in Sitecore

Abstract

How to enable the Insert from Sitecore DAM function in the Sitecore Connect for Content Hub connector

The Sitecore Connect for Content Hub (SCCH) installation adds the Insert from Sitecore DAM item to the Rich Text Default profile for the Rich Text Editor. To enable the Insert from Sitecore DAM function, you must configure a connection to the Sitecore Digital Asset Management (DAM) part of the SCCH connector.

To configure the connection to Sitecore DAM in Sitecore:

  1. Open the C:\inetpub\<site>\App_Config\ConnectionStrings.config file, and add the following connection strings:

    <add name="DAM.ContentHub" connectionString="ClientId={client_id};ClientSecret={client_secret};UserName={username};Password={password};URI={uri};" />
    <add name="DAM.SearchPage" connectionString="<Sitecore Content Hub search page URI>" />
    <add name="DAM.ExternalRedirectKey" connectionString="Sitecore" />

    Substitute the placeholders in the example with the values from this table:

    Placeholder

    Value

    Sitecore Content Hub URI

    The URI for your Sitecore Content Hub DAM instance, for example, https://dam-connector.stylelabs.qa.com.

    Sitecore Content Hub search page URI

    The URI for the page that opens the DAM in an IFrame. For example, <Sitecore Content Hub DAM URI>/en-us/sitecore-dam-connect/approved-assets.

    Note

    The user account using the connector must have read access to the connector pages in Sitecore DAM.

  2. Save the changes.

  3. In the root folder (by default, wwwroot), open the web.config file. Make sure the URL of the Content Hub instance (for example, content-hub-url.stylelabs.com), other delivery hostnames (for example, content-hub-url-delivery.stylelabs.cloud), and generated public links (for example, content-hub-url.stylelabs.com:8686) are added as sources to the Content-Security-Policy tag. For example:

    <add name="Content-Security-Policy" value="default-src 'self' 'unsafe-inline' 'unsafe-eval' https://apps.sitecore.net;
        img-src 'self' data https://content-hub-url.stylelabs.com/ https://content-hub-url-delivery.stylelabs.cloud/;
        style-src 'self' 'unsafe-inline' https://fonts.googleapis.com;
        font-src 'self' 'unsafe-inline' https://fonts.gstatic.com;
        upgrade-insecure-requests; block-all-mixed-content;
        child-src 'self' https://content-hub-url.stylelabs.com/ https://content-hub-url-delivery.stylelabs.cloud/;
        connect-src 'self' https://content-hub-url.stylelabs.com/ https://content-hub-url-delivery.stylelabs.cloud/;
        media-src https://content-hub-url.stylelabs.com/ https://content-hub-url-delivery.stylelabs.cloud/;" />

    Note

    In Content Hub, you can configure different delivery hostnames for public links by using the AssetExtensionDataConfigurationSetting setting.

    If you have configured different hostnames, you must add all the hostnames as sources. You do this in the Content-Security-Policy parameter, in the img-src, child-src and connect-src properties.

  4. The Insert from Sitecore DAM icon Sitecore DAM icon is now available in the Rich Text Editor for fields that use the Rich Text Default profile. If you want to access DAM assets in profiles other than Rich Text Default:

    • In the Core database, navigate to /sitecore/system/Settings/Html Editor Profiles/Rich Text Default/Toolbar 1.

    • Copy the Insert from Sitecore DAM item.

      The Insert from Sitecore DAM item in the content tree
    • Navigate to the Rich Text Editor profile you intend to use, and paste the Insert from Sitecore DAM item.