Adds support for Discourse SSO. This means that Aleph becomes the authentication authority for a Discourse instance.
When users try to login on Discourse, they get redirected to CKAN. If they are logged in on CKAN or login when prompted, they get redirected back to Discourse.
Discourse will verify the user's email address (which it gets from CKAN) so that your discourse instance doesn't become a way to spam your CKAN users.
Tested with CKAN 2.7.2 and Discourse v2.0.0.beta4 +97
To install ckanext-discourse-sso:
Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate
Install the ckanext-discourse-sso Python package into your virtual environment:
pip install git+https://github.com/OpenUpSA/ckanext-discourse-sso.git@v0.0.1
Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu:
sudo service apache2 reload
- Make up some random secret string and enter it in the
sso_secretsettings field - Enter your CKAN URL with the
/discourse/ssosuffix in thesso_urlfield, e.g.https://data.example.com/discourse/sso
- Add
discourse-ssoto theckan.pluginssetting in your CKAN config file (by default the config file is located at/etc/ckan/default/production.ini). - Set the config variable
discourse.sso.secretto be the same value assso_secretin your Discourse settings. You can do this via theCKAN_DISCOURSE_SSO_SECRETenvironment variable. - Set the config variable
discourse.urlto be your Discourse intance, e.g.https://discourse.exampe.com/. You can do this via theCKAN_DISCOURSE_URLenvironment variable.
To install ckanext-discourse-sso for development, activate your CKAN virtualenv and do:
git clone https://github.com/OpenUpSA/ckanext-discourse-sso.git cd ckanext-discourse-sso python setup.py develop