Is it possible to embed Discourse into a Salesforce Community (Experience Cloud site) using an iframe? If yes, how?

I’m using the Business Trial and following this article. LWC is being used as the wrapper for Discourse. Since LWC doesn’t allow adding the and tags to the HTML markup, I downloaded the JavaScript library from myDiscourseAcc.discourse.group/javascripts/embed.js, saved it to my Salesforce org as a static resource, and loaded it into LWC.

The iframe displays, but it always shows the login page and the “Log in to Reply” button. But, I need to display the forum and all its features - I cannot do this.

  1. In LWC, I specified discourseUrl, discourseEmbedUrl, and fullApp (set to true) for window.DiscourseEmbed.
  2. The SF community site has been added in Admin → Embedding → hosts. Full App Mode is enabled.
  3. Discourse Connect is working fine, and the necessary settings for it are also configured.
  4. On the Salesforce org, Discourse has been added to Trusted URLs.
  5. When logging into the community, no errors occur, neither in the community’s logs nor in Discourse’s logs
  6. When loading the community, I can set up a redirect to Discourse and back to obtain SSO and SIG via the URL
  7. when I click a custom button or the “Log in to Reply” button (inside displayed discourse iframe), I can open Discourse in a separate window or a separate tab.

But despite this, the login page remains open inside the embedded iframe

1 Like