Possible to create a Sign in with Ghost plugin for Discourse?

A year and a half ago the Discourse on Ghost integration was announced, allowing Ghost members to seamlessly access the site’s forum with the same permissions they have on the publication. One “downside” of the integration is that it requires installation on a VPS, a task that many users of Ghost and/or Discourse may find a bit too daunting (as has been discussed on Ghost’s forum over the past few days).

Here on Discourse’s forum, the following was stated a few days ago about the integration of the two platforms:

While this would be great, another option might be the creation of a “ready-to-use” version that could be set up with Cloudflare Workers. While this would remove some of the friction for neophytes, an even better option might be the creation of a Discourse plugin, supposing such a thing is even possible. Seeing how there’s already a Sign in with Apple plugin, might this suggest that a Sign in with Ghost plugin might also technically be possible?

5 Likes

It’s doable, yes. Are there any docs somewhere for configuring Ghost as an identity provider? If yes and if oAuth is supported, you can likely use existing tooling to set this up without the need for a dedicated plugin.

4 Likes

I’ve been told “No, Ghost isn’t exactly designed to be an IDP”. That being so, do plugins allow for adding new endpoints, making that route possible?

Edit:

Can groups be defined by the plugin so that (assuming that Ghost will send webhooks) when a user’s subscription changes groups can be synced?

2 Likes

So the current Discourse-on-Ghost integration would only need the D-o-G functionality to be self-hosted and not necessarily Ghost. Since that integration uses DiscourseConnect, it will work fine with any Discourse install out of the box, regardless on how it’s hosted.

Which would require self-hosting Discourse. So what problem would it solve? The burden would shift from self hosting a relatively simple Ghost-add on, to self-hosting Discourse.

4 Likes

Darn, alright, I hadn’t realised that unofficial & custom plugins were only available for Enterprise plans. I see what you mean then when you say that “The burden would shift from self hosting a relatively simple Ghost-add on, to self-hosting Discourse.” Problem is, while self-hosting the “simple add-on” may be too troublesome for the tech-challenged, some may want the reassurance that nothing is in their hands and that all operations are safe in the hands of the more competent.

That all being so @pmusaraj, seeing how custom plugins are available only for Enterprise plans, is it effectively the case that plugin-wise the only options are on the “extremes” – either self-hosting or Enterprise? I totally understand why custom plugins wouldn’t be available for Starter plans as Discourse needs to make some money to maintain itself, but might there be some middle-path here? Or alternatively, might there still be some other route besides a plugin or “configuring Ghost as an identity provider” that hasn’t been addressed?

2 Likes

I’m not sure how realistic it is, but the Ghost platform could probably implement DiscourseConnect for their hosted sites.

Another option is that an official Discourse Ghost plugin could be created and added to the plugins that are available on hosted Discourse sites.

Either case would probably depend on their being a fair amount of demand for Discourse/Ghost integration.

1 Like

If only there were a company cough that offered both official and non-official plugins on affordable hosted plans :wink:

But seriously, I think that such a solution should be widely available and not depend on a specific service.

It seems that D-o-G uses JWT integration towards Ghost. There is a JWT plugin for Discourse (official but only on enterprise plan?). That might be a direction worth investigating.

2 Likes

I’m not familiar enough with Ghost to properly advise here, but, I can say this:

  • our recommended approach is to use existing standards for authentication, because, well, security is key when it comes to accounts and logins. For example, GitHub - discourse/discourse-oauth2-basic: A basic OAuth2 plugin for use with Discourse or Discourse OpenID Connect, available on the business tier of our official hosting. Or SAML, for the enterprise-inclined.
  • Given these plugins above, I don’t think a specific Ghost auth plugin for Discourse is warranted. Ghost would need to support one of these standards, and once they do, you don’t need a specific Ghost plugin. We’re open to collaborating here, but my gut feeling is that Ghost would need to do the heavy lifting of adding some IDP features to their offering.
  • The JWT route is also an option, as @RGJ noted, the plugin exists and it can likely be configured to do the same thing as the D-o-G intermediary. It’s a bit of an outdated standard though and we generally recommend OAuth, OpenID, SAML or DiscourseConnect.
3 Likes