Configure the DAM connector in Sitecore
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.
The DAM.ContentHub
connection string you configure in this procedure is only used for sending API requests related to configuring the Image tag attribute mapping in Sitecore when a public link is selected in the Insert from Sitecore DAM dialog.
To configure the connection to Sitecore DAM in Sitecore:
-
As part of configuring the connection string, you'll need to provide a client ID and secret from Content Hub. To access this information, open Content Hub and, on the ribbon, click Manage > OAuth Clients > LogicApp > Edit. Make a note of the values for Client Id and Client Secret settings.
-
Open the
C:\inetpub\<site>\App_Config\ConnectionStrings.config
file, and add the following connection strings:NoteAs part of this step, you must provide the Client ID and Client secret from the LogicApp settings in Content Hub. To access this information, open Content Hub and, on the ribbon, click Manage, click OAuth Clients, click LogicApp, and click Edit. Make a note of the Client id and Client Secret settings
RequestResponse<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" />
NoteThe connection string
DAM.ContentHub
is only used to execute API related to configure the image tag attribute mapping in Sitecore when a public link is selected in the Insert from Sitecore DAM dialog.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
.ClientId
andClientSecret
The LogicApp OAuth client settings you noted in step 1.
User Name
andPassword
The user name and password of the user previously created in Sitecore Content Hub.
NoteThe user account using the connector must have read access to the connector pages in Sitecore DAM.
-
Save the changes.
-
In the root folder (by default,
wwwroot
), open theweb.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 theContent-Security-Policy
tag. For example:RequestResponse<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/;" />
NoteIn 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 theimg-src
,child-src
andconnect-src
properties. -
The Insert from 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.
-
Navigate to the Rich Text Editor profile you intend to use, and paste the Insert from Sitecore DAM item.
-