Hi , I wrote this SimpleSAMLphp authentication module to be able to use Discourse as an SSO provider within a SimpleSAMLphp installation. I.e. you can use Discourse as an SSO provider for any services that supports SAML or Shibboleth authentication, which is really nice.
https://github.com/swcc/simplesamlphp-module-authdiscourse
Let me know what you think (if interested to comment on the code you can use Github Issues).