
ckanext-emailasusername
We have have found that many of our users quickly forget their CKAN username.
We have also observed several users assume they should use their email to
login. This fails with a bad login error message, which causes some confusion.
This CKAN extension allows users to login or reset their password with either
their email address or their username. It doesn’t do away with the username
but just offers the option to use email instead.
Out of the box, CKAN allows multiple accounts to be registered with the same
email address. This causes a problem for using email to identify the user.
This extension therefore adds a validator to the registration form to stop
new accounts being created if there already exists an account with the same
email.
If multiple accounts are registered to your email, then identifying the user
by email fails - you must use your username to login/reset your password
instead. It’s recommended, if feasible, to work with your userbase to phase
out multiple accounts with the same email.
Requirements
This extension is tested with CKAN 2.9 for python3 only.
Installation
To install ckanext-emailasusername:
Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate
Install the ckanext-emailasusername Python package into your virtual environment::
pip install ckanext-emailasusername
Add emailasusername to the ckan.plugins setting in your CKAN
config file (by default the config file is located at
/etc/ckan/default/production.ini).
Configure CKAN to use the authenticator provided in this plugin. Add
ckanext.emailasusername.authenticator:EmailAsUsernameAuthenticator to
the [authenticators] plugins configuration in CKAN