Discourse SSO module for SimpleSAMLphp

Hi everyone,

I’ve put together a SimpleSAMLphp module for connecting to Discourse SSO: https://github.com/reswild/discourse

The code that does all the work is taken from cviebrock/discourse-php, so all I did was hook this up to a SimpleSAML authentication source. I haven’t tested it too much so far, but in theory it should work with any authentication source supported by SimpleSAMLphp, so SAML, Shibboleth, CAS, OpenID, OAuth, and many others. For more information, see https://simplesamlphp.org/.

This is the first SimpleSAMLphp module I’ve written, so any comments or suggestions are welcome.


Hi @reswild,

thanks for sharing this! I am new at setting up an SSO and found your SimpleSAML module which seems great. I do however have some questions.

  • Is your SimpleSAML module done to use Discourse as a Service Provider (I.e. allow a SimpleSAML user to login into Discourse automatically)?
  • Is your SimppleSAML module done to use Discourse as an Identity Provider (I.e. allow SimpleSAML to delegate authentication of users to the Discourse application)?

From your documentation I think it’s a module to use Discourse as a SP (service provider), do you have any idea how I can setup SimpleSAML to use Discourse as an IP (identity provider)?

Many thanks for your help!

I will answer my own questions:

  • @reswild 's module enables the use of Discourse as a Service Provider (Allow SimpleSAML users to login into Discourse automatically if they are authenticated in SimpleSAML)
  • Here is a brand new authentication module I wrote to enable the use of Discourse as an Identity Provider (Use Discourse accounts to authenticate in SimpleSAML - and thus authenticate automatically on other services SP): https://github.com/swcc/simplesamlphp-module-authdiscourse

Hope this will help others :wave: