Using Discourse as a SSO on a headless WP install

Hey! I’d love to use Discourse as a SSO on a headless WP installation. Is it possible with the current WP discourse plugin? I’d like to use it for auth in WP so I can build functionality in WP, while avoiding for the users to have more than one account, and Discourse has the best user management of the two :slight_smile:

Any ideas on how to implement this? What would be ideal is if all the users could be synchronized into Wordpress somehow, so that all authentication can be handled through WP but they will still be authenticated into both Discourse and WP. That way I can handle the authentication on the front end of the headless app…

1 Like

When users are logged into WordPress with Discourse as the SSO provider, the login process begins by redirecting the user to

http://example.com?discourse_sso=1&redirect_to=http://example.com/your-landing-page.

It should be possible to get this to work with a headless WordPress site. Let us know if ou run into any problems with it.

2 Likes

Thank you! Realized that the auth aspect of the site was out of scope for this project, but if I ever implement it in a future project I’ll get back if I run into issues :slight_smile: