Bratwurst: the wurst possible production SSO provider

(Michael Brown) #1

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

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 SSO response values. Fun!

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

$ git clone

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 development mode Discourse on port 3000, configure your SSO URL to be: http://localhost:3333/sso and this secret as the default: thisisabadideatouseoutsideofssotesting

Login to Discourse with custom Oauth2 provider
(Blake Erickson) #2

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