Skip to main content
Skip table of contents

Salesforce refused to connect/'X-Frame Options' - deny problem

The problem

When clicking on a Dynamo link/button in Salesforce, user sees the error Salesforce (salesforce.com or test.salesforce.com ) refused to connect' page or a blank page instead of the template list or the directed template.

image-20231229-122040.png

Upon clicking F12 on the keyboard to open the browser developer console, a more descriptive explanation of the error is displayed, which is Salesforce refused to display the URL because it set 'X-Frame-Options' to 'deny'.

image-20231229-122129.png

Troubleshooting guide

This Salesforce authorization problem can be overcome by using oathLoginURL parameter to override the default Salesforce oauth URL domain. The parameter to specify which environment the org is should also be passed in the URL.

Steps to troubleshoot:

  1. Create a new VisualForce page with the following markup:

CODE
<apex:page applyBodyTag="false">
  <apex:stylesheet value="https://dynamo.documill.com/visualforce/dynamo-vf.css" />
  <apex:includeScript value="https://dynamo.documill.com/visualforce/dynamo-vf.js" />
  <head></head>
  <body>
      <div class="dynamo-container">
          <div class="dynamo-loading"></div>
          <apex:iframe width="100%" height="100%" src="https://dynamo-eu1.documill.com/service/sfdco?useFlow=true&customListenerURL=*&serverURL={!$Api.Partner_Server_URL_330}&id={!$CurrentPage.parameters.id}&templateID={!$CurrentPage.parameters.templateID}&oauthLoginURL={!LEFT($Api.Partner_Server_URL_330, FIND( '/services', $Api.Partner_Server_URL_330))}&sfEnvironment=sandbox"></apex:iframe>
      </div>
      <script>initDynamoVisualforce("/{!$CurrentPage.parameters.id}");</script>
  </body>
</apex:page>

The VisualForce page markup above is meant for a sandbox environment (&sfEnvironment=sandbox). So when moving to live/production environment, please change to &sfEnvironment=production.

  1. Point the Dynamo button to this new VisualForce page. The modified URL for the button should be in the form: /apex/newDynamoFrame?id={!Object.Id} 

When encountering the 'X-Frame Options denied' issue on Firefox (end users see a blank page), it could be due to the Firefox browser blocking some Salesforce content (including embedded Dynamo page).

A user can allow all Salesforce content to be displayed on their Firefox browser by:

  • Click on the shield icon next to the site URL

  • In the opened window, click on 'Turn off Blocking for This Site'

This browser setting will be remembered for Salesforce site and will not block any content from Salesforce site moving forward.

image-20231229-122201.png
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.