Bratwurst: the wurst possible production DiscourseConnect provider

AI-generated summary

Bratwurst: the wurst possible production DiscourseConnect provider

supermathie created a DiscourseConnect provider called Bratwurst for development and testing purposes. It’s available on GitHub and allows users to configure an SSO backend to test different scenarios. To use Bratwurst, clone the repo, install gems, and run the server. Then, configure the SSO URL to http://localhost:3333/sso and use the secret thisisabadideatouseoutsideofssotesting. blake shared additional resources on implementing SSO in Ruby, including a Meta Discourse post and their own GitHub repositories (sso_endpoint and its README).

I felt like making something the other night, so I implemented an DiscourseConnect provider that is useful for development and testing:

https://github.com/Supermathie/bratwurst

The utility of this is to be able to configure an SSO backend so that you can test out the behaviour of Discourse with different scenarios from an external provider (e.g. “What happens if two users have the same email but different external IDs? What happens if the external ID changes? What happens if two users have the same username?”)

It 100% trusts the user to enter the correct response values. Fun!

If you’re already set up for development you should be able to clone the repo:

$ git clone https://github.com/Supermathie/bratwurst.git

Install gems:

$ bundle install

and run the server:

$ rails server -b '[::]' -p 3333

then test by pointing your browser at http://localhost:3333/.

To run it against a local development mode Discourse, configure your SSO URL to be: http://localhost:3333/sso and this secret as the default: thisisabadideatouseoutsideofssotesting

Screenshot in action:

Just adding this here in case someone is in need of yet another example of how to do this in ruby:

https://meta.discourse.org/t/official-single-sign-on-for-discourse-sso/13045/372?u=blake

https://github.com/oblakeerickson/sso_endpoint