Example code for how a hosted solution would integrate with discourse

There are hosted solutions that allow for integrating with discourse.

Is there any sample code of what the hosted solution would have to do to integrate with discourses login system?

Example, patreon has a plugin that enables patreon users to login to discourse. I’m looking for sample code of what a hosted solution like Patreon would have to do on their end to allow for this type of integration.

I might have my terminology wrong but this would be Patreon as a SSO provider correct?


1 Like

Oh we have a fair bit of examples on that:


If your website uses Ruby and Rails, you can copy and paste the file https://github.com/discourse/discourse/blob/master/lib/single_sign_on.rb on your lib directory to do all the heavy lifting and then add the necessary controller and route.