Extension Email Auth


Extension Basics

Title
Email Auth
Name
ckanext-emailauth
Type
Public extension
Description
CKAN extension for custom authentication model using email as primary identifier, including email verification, username/email login, and password reset functionality.
CKAN versions
Download-Url (zip)
Last commit
4 years ago (2021-06-21 08:38:19)
Url to repo
Category
Authentication & Security


Background Infos

Description (long)
Show details

ckanext-emailauth

CKAN Authentication using Email as primary identifier including username.

Features

ckanext-emailauth allows you to:

  1. Enable registration / login via email or username
  2. Do email verification based on any SMTP server as per configuration you provide
  3. Ability to store extra user information as key-value pair in user_extra table
  4. 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:

  1. Activate your CKAN virtual environment:

    . /usr/lib/ckan/default/bin/activate
    
  2. Clone repository and install the requirements first:

    pip install -r requirements.txt
    
  3. Install extension into your virtual environment:

    python setup.py install
    
  4. Add emailauth to the ckan.plugins setting in your CKAN config file.

  5. Follow configuration step below to add necessary details and then do Database Initialization.

  6. 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

Version
0.1.0
Version release date
2021-06-21
Contact name
JusticeHub
Contakt email
(not set)
Contact Url
(not set)


Installation Guide

Configuration hints

Add ‘emailauth’ to ckan.plugins. Requires SMTP configuration and database initialization. Must modify who.ini to add EmailAuthenticator. Built for JusticeHub theme - may need modifications for general use.

Plugins to configure (ckan.ini)
emailauth
CKAN Settings (ckan.ini)
ckan.mail.key=email_id@domain.com
ckan.mail.secret=password
ckan.mail.sent_from=email_id@domain.com
password.reset_key.expiry_hours=4
DB migration to be executed
ckan -c /path/to/ckan.ini user_validation initdb ckan -c /path/to/ckan.ini user_extra initdb
<< back to Extensions