Login to CKAN using Drupal's session cookie
Project description
ckanext-drupal-idp
When Drupal's session cookie is available use it for user authentication. Create missing users, using data from Drupal's DB and synchronize(conditionally) fields when user details changed on Drupal's side.
Requirements
- python >= 3.6
- CKAN >= 2.9
Installation
To install ckanext-drupal-idp:
-
Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate
-
Clone the source and install it on the virtualenv
git clone https://github.com/DataShades/ckanext-drupal-idp.git cd ckanext-drupal-idp pip install -e .
-
Add
drupal-idp
to theckan.plugins
setting in your CKAN config file (by default the config file is located at/etc/ckan/default/ckan.ini
). -
Configure Drupal's DB:
ckanext.drupal_idp.db_url =
-
Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu:
sudo service apache2 reload
Config settings
None at present
TODO: Document any optional config settings here. For example:
# Defines database used by the Drupal application
# (mandatory).
ckanext.drupal_idp.db_url = mysql://drupal_user:drupal_pass@127.0.0.1:3306/db_name
# Whether to make an attempt to synchronize user's email and name everytime
# session is used. This may result in unauthenticated session if new name or email
# already present in CKAN database
# (optional, default: false).
ckanext.drupal_idp.synchronization.enabled = true
Developer installation
To install ckanext-drupal-idp for development, activate your CKAN virtualenv and do:
git clone https://github.com/DataShades/ckanext-drupal-idp.git
cd ckanext-drupal-idp
python setup.py develop
pip install -r dev-requirements.txt
Tests
To run the tests, do:
pytest --ckan-ini=test.ini
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ckanext-drupal-idp-0.0.1.tar.gz
.
File metadata
- Download URL: ckanext-drupal-idp-0.0.1.tar.gz
- Upload date:
- Size: 21.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5326a1f1c2ba87dc3107f9f15a3dee698148ea62360a17d9a1f16d6fb50bcf46 |
|
MD5 | fad3ff5da30dc7cb794ffd21d32305e0 |
|
BLAKE2b-256 | 248b1951a98d8005047c802ab1ccdaff87cb5b36295cf1b10ea2daeb7f7ca2d2 |
File details
Details for the file ckanext_drupal_idp-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: ckanext_drupal_idp-0.0.1-py3-none-any.whl
- Upload date:
- Size: 21.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34d76a00f325cc4dd186943053892218f93e29b6fcca599bc42ea08c5b2734eb |
|
MD5 | 5ec79a68eba7ff5960b0e3cbeccd92e4 |
|
BLAKE2b-256 | 27a72e6d97b7c3430e37160f43ccb654d5a4798a4afc943209c954b007c45d22 |