Drupal 8 and Discourse shared SSO

AI-generated summary

In a discussion about integrating Drupal 8 and Discourse via shared Single Sign-On (SSO), Mike_Wellman asks for advice on synchronizing logins between the two platforms, both of which rely on Laravel SSO. He notes they’re using a customized OAuth2 Basic setup and that Drupal and Discourse are subdomains of the same domain. JonathanShaw suggests using DiscourseConnect, where Discourse verifies logins via Drupal, which in turn authenticates through Laravel OAuth. He mentions the existing discourse_sso Drupal module lacks features for syncing user data updates and bidirectional logout, and shares he’s developing a more robust Drupal module — currently needing tests — and invites collaboration. MikeNolan responds, asking if Jonathan’s project is still active and offering help from the US Chess Federation, which uses Discourse-hosted forums.

Hello,

I was wonder if anyone has tried doing this or has any tips on how to do this.

We have a Drupal 8 site and a Discourse forum. Both systems use an external site that uses Laravel Single Sign-On.

What we are trying to do is if you are logged into the Drupal 8 site, you are automatically logged into Discourse. We are using a customized version of OAuth2 Basic so we can do role management between the system so we can modify as we need to for the Shared Session between the sites.

Drupal is setup as a Subdomain xxxxx.samemaindomain.com
Discourse falls under that: yyyyyy.xxxxx.samemaindomain.com

Does anyone have any advice on how to move forward with this issue?

Thanks ahead of time.

I think you can make this work fine with DiscourseConnect. Discourse queries Drupal to verify a login using DiscourseConnect, and Drupal queries Laravel via oauth.

The discourse_sso Drupal contrib module works OK, but it lacks a mechanism for updating of Discourse data when the Drupal user is updated and a working mechanism for logout syncing in both directions.

For these reasons I’ve done most of the work on a better Discourse module for Drupal. Mainly it needs tests. Interested in collaborating?

Johnathan, is your drupal sso project still active?

We might be interested in helping with it at the US Chess Federation. (We’re a discourse-hosted site.)