How to use the Discourse auth system for another app?


(Ronny Chan) #1

I’m building a webapp and I want to integrate with Discourse so that Discourse handles auth, the user would log in through Discourse, and the app would rely on Discourse for auth and user database. How would I go about doing this?


(Sam Saffron) #2

Discourse implements its own SSO protocol per

You just need to enable enable sso provider in the site settings and then make calls to /session/sso_provider per spec.

I implemented a golang proxy (but only for admins) GitHub - discourse/discourse-auth-proxy: An http proxy that uses Discourse sso to authenticate users


Use Discourse login for second Rails app
(Ronny Chan) #3

I’m not trying to integrate outside auth with Discourse, I don’t have existing auth. Instead, I want to offload auth responsibilities for my app to Discourse, so the app uses Discourse auth to authenticate its users. Is there any way to do that?


(Sam Saffron) #4

Read my reply carefully, read the linked code.


(Ronny Chan) #5

So, I would have to implement SSO on my app side and enable the SSO provider setting in Discourse?


(Sam Saffron) #6

Yes that is what you would do


(Paxmanchris) #7

You can also checkout my post on this: