Allows users to login with email as well as username.
Project description
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
For example, you might want to mention here which versions of CKAN this extension works with.
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’s who.ini file. In ckan core, thise who.ini file is stored in ckan/ckan/config and linked to from ckan/:
[authenticators] plugins = auth_tkt ckanext.emailasusername.authenticator:EmailAsUsernameAuthenticator
Restart CKAN. For example if you’ve deployed CKAN with Apache on Ubuntu:
sudo service apache2 reload
Running the Tests
To run the tests, do:
nosetests --nologcapture --with-pylons=test.ini
To run the tests and produce a coverage report, first make sure you have coverage installed in your virtualenv (pip install coverage) then run:
nosetests --nologcapture --with-pylons=test.ini --with-coverage --cover-package=ckanext.emailasusername --cover-inclusive --cover-erase --cover-tests
With thanks…
This extension has been built by Fjelltopp with funding from UNAIDS as part of the AIDS Data Repository project: https://adr.unaids.org
Project details
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
Hashes for ckanext-emailasusername-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd5cf551b6a1756d6cd8bdfac762b734d674d8edc92beffa0a625bf3fed4d619 |
|
MD5 | d88acd79fc497803b3f124e91780082b |
|
BLAKE2b-256 | a39944c959d92493923f2ae9d0cc98592c124c0e9e2e40b6f6098a1e4707930f |
Hashes for ckanext_emailasusername-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4a856f7b7d129c920dd34fae59215a11bac389e6b4d2022a7975714c68401bf |
|
MD5 | 9dde0adc07c7752427d6241207c671e2 |
|
BLAKE2b-256 | 16dcfc93b3bff3b79b9c3ea7b32b32baa68d468cd123a8fa7c900b256c0e3ce4 |