ckanext-emailauth
CKAN Authentication using Email as primary identifier including username.
Features
ckanext-emailauth allows you to:
- Enable registration / login via email or username
- Do email verification based on any SMTP server as per configuration you provide
- Ability to store extra user information as key-value pair in user_extra table
- Reset password via email verification link with link expiry
Requirements
Supports Python 2.7 and Python 3.8, tested with CKAN 2.8.4 / CKAN 2.9.1
Installation
To install ckanext-emailauth:
Activate your CKAN virtual environment:
. /usr/lib/ckan/default/bin/activate
Clone repository and install the requirements first:
pip install -r requirements.txt
Install extension into your virtual environment:
python setup.py install
Add emailauth to the ckan.plugins setting in your CKAN config file.
Follow configuration step below to add necessary details and then do Database Initialization.
Restart CKAN.
Configuration
ckanext-emailauth has few custom configuration which is required before running:
ckan.mail.key=email_id@domain.com
ckan.mail.secret=password
ckan.mail.sent_from=email_id@domain.com
# Optional
password.reset_key.expiry_hours=4
Database Initialization
ckanext-emailauth requires two custom tables which need to be initialized.
For CKAN 2.8 or less:
paster user_validation initdb -c /path/to/development.ini
paster user_extra initdb -c /path/to/development.ini
For CKAN 2.9 or greater:
ckan -c /path/to/ckan.ini user_validation initdb
ckan -c /path/to/ckan.ini user_extra initdb
Modifying Authenticator
In your who.ini file add custom authenticator as:
[authenticators]
plugins =
auth_tkt
ckanext.emailauth.authenticator:EmailAuthenticator
This will enable EmailAuthenticator during all authenticator process, allowing authentication via both username and email.
Note
This plugin was primarily built for the JusticeHub theme and may require some modifications for general usage. Future improvements planned include configurable schema and templates.
License
AGPL-3.0 license