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. I’ve come to this conclusion because I can access Discourse through SF-community, and I can automatically log in to Discourse using my community-user when I log in.
  4. On the Salesforce org, Discourse has been added to Trusted URLs.
  5. When logging into the community, no errors occur, neither in the SF-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.
  8. Salesforce Community and my Discourse instance are on different domains.

But despite this, the login page remains open inside the embedded iframe. I’m not sure, but the problem might be with the cookies

Your options are either:

  1. Move Discourse and Salesforce site to share the same base domain, like forum.yoursite.com and crm.yoursite.com.

  2. Change same_site_cookies from Lax to None. It involves Using Hidden Site Settings