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/[email protected]
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_secret
settings field - Enter your CKAN URL with the
/discourse/sso
suffix in thesso_url
field, e.g.https://data.example.com/discourse/sso
- Add
discourse-sso
to theckan.plugins
setting in your CKAN config file (by default the config file is located at/etc/ckan/default/production.ini
). - Set the config variable
discourse.sso.secret
to be the same value assso_secret
in your Discourse settings. You can do this via theCKAN_DISCOURSE_SSO_SECRET
environment variable. - Set the config variable
discourse.url
to be your Discourse intance, e.g.https://discourse.exampe.com/
. You can do this via theCKAN_DISCOURSE_URL
environment 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