Sitecore10 —The content is blocked issue solved

Only Sitecore
2 min readMar 12, 2021

--

I was trying to connect/integrate Sitecore content hub to my Sitecore 10.1 instance. I was following the documentation mentioned here

Everything was just fine. The package and the DAM side configuration was just fine all good to go. Then I tried opening “Rich Text Editor” and tried to click this button

It tries to connect to “Content Hub” but at the end I got this message:

The content is blocked. Contact the site owner to fix the issue”

I was a bit frustrated then I tried to understand what went wrong. I found a very interesting console error which pointed to: “request is blocked because it violates the following Content Security Policy directive: “default-src ‘self’”. Note that ‘frame-src’ was not explicitly set, so ‘default-src’ is used as a fallback

Which was enough to dig-down the actual problem. The solution is to make sure your “Content-Security-Policy” is correctly configured to be able to load this external page into Sitecore.

Luckily, Sitecore has a configuration to handle your different custom headers. You just need to open “web.config” and search for “customHeaders” section.

For my case, i just needed to allow my url there. You can put the app url that you tried to load. That’s it.

“child-src ‘self’ https://yourappsendpoint/; connect-src ‘self’ https://yourappsendpoint/;”. You can simply add this line with the existing one.

You can now load your external app inside Sitecore without any problems.

Cheers

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response