Discourse with SSO from Nextcloud

Couldn’t find a guide for this. But what I’d like to do is to “integrate” Discourse as an “app” inside the open source collaborative environment Nextcloud. I believe this is done by opening Discourse - kind of like an iframe - as an “external site” in Nextcloud. These are my steps:

  1. Notice there is some kind of “integration app” for using SSO between Nextcloud/Discourse:
    Discourse SSO - Apps - App Store - Nextcloud

  2. In Nextcloud, go to + Apps -> Integration -> Discourse SSO. Install this, and enable it.

  3. Go to my settings, and enter my SSO information:

  4. I go to my Discourse forum site (which is in Swedish, sorry), and go to my admin settings:

    And scroll down to fill out these 3 fields:

  5. I log out from both Discourse and Nextcloud. Log in to Nextcloud (using the same email at both Nextcloud and Discourse), but cannot successfully open the “external site” to reveal my Discourse forum.

Why does Firefox interpret my forum as being embedded?

Are you sure you’re using the correct endpoint for sso?

Second would be to see if CSP is causing this behaviour (I’m not sure how or why)

I’ve tried disabling SSO, but the subdomain where my forum is located still cannot be opened within Nextcloud. My regular domain name does however open.
By CSP you mean the Cloud Service Provider where my Discourse is at?

From Nextcloud

Your links may or may not work correctly due to the various ways that Web browsers and Web sites handle HTTP and HTTPS URLs, and because the External Sites app embeds external links in IFrames.

Discourse does not work in an <iframe> tag and your Discourse server will refuse the connection.


Thank you! But why then is there a “SSO integration” app, if the integration is impossible? Is there some workaround to allow for Discourse to be embedded as an iframe?

Edit: I created a post at the Nextcloud forum now. Will report back if I get any clarity from there.

Okay, so a user at the Nextcloud forum simply confirms that Discourse seems to be the issue, as it does not work in iframe. A quick google pointed me to this 4 year old Github project though:

After I’ve edited app.yml to account for this plugin, what do I do next? Do I need to rebuild Discourse to fully install it?

Yes, a rebuild will be required to install any plugin

Just as a heads up, a plugin not maintained for over 4 years has a strong chance of breaking.

1 Like

You can submit issues and feature requests on the project github. Note it hasn’t been updated for version 20 yet. Click for details.

1 Like

Thanks for the tip! You haven’t used this app yourself, have you?

For the record: I installed the “allowifram”-plugin, and my Discourse did indeed crash. :stuck_out_tongue:

For anyone interested, I did ask the developer if there had been an attempt to integrate Discourse into Nextcloud: Amend so that Discourse can be opened within Nextcloud? · Issue #18 · soudis/discoursesso · GitHub
The developer said no, but that he/she had hacked around the iframe issue with the following plugin: GitHub - soudis/discourse-allow-same-origin
Have not yet tried it myself.