Use main website as Oauth Server for my discourse forum


(Gaurab Patra) #1

My requirement is to create a forum with discourse which can only be logged in using the main website’s credentials.
i.e., when the user goes to discourse.example.com (say) it checks whether the users is already logged in to the main site, if not, it presents with a “login” button. When the user clicks the login button, it redirects to the main site’s login page, and after successful login, it redirects the user to the desited discours.example.com topic.
My requirement is quite similar to that of : https://twittercommunity.com/
How to do that.
My main site is running on MEAN stack,


#2

Have you looked at Discourse’s SSO capabililties?


(Gaurab Patra) #3

I could find Discourse as SSO provider, but I need discourse to be the SSO consumer and own website as the SSO provider. If it’s possible, could u provide some sort of documentation of the same.


(Matt Palmer) #4

The topic @abraae linked to is all about using Discourse as an SSO consumer. You could also use OAuth2, if that’s easier to implement on your main site; there’s a plugin available for Discourse to make it an OAuth2 consumer.