2FA authentication for CKAN
Project description
This extension partially based on the ckanext-security
The extension provides a 2FA authentication mechanism for CKAN.
There are two methods of 2FA available:
- TOTP (Time-based One-Time Password) with authenticator apps like Google Authenticator, Authy, etc.
Requirements
Python 3.11+
This extension uses Redis, so it must be configured for CKAN.
Compatibility with core CKAN versions:
| CKAN version | Compatible? |
|---|---|
| 2.9 and earlier | no |
| 2.10 | yes |
| 2.11 | yes |
If you want to add compatibility with CKAN 2.9 and earlier, you can contact me and I'll help you with that.
Installation
To install ckanext-auth:
- 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-auth.git
cd ckanext-auth
pip install -e .
-
Add
authto theckan.pluginssetting in your CKAN config file (by default the config file is located at/etc/ckan/default/ckan.ini). -
Apply database migrations:
ckan db upgrade
- Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu:
sudo service apache2 reload
Config settings
There are several configuration settings available for this extension. Check the config declaration file.
If you have the ckanext-admin-panel installed, the configuration settings will be available in the admin panel too.
How to
- If you want to change the email for email 2FA, you can do it by creating a new template file at
auth/emails/verification_code.html.
Tests
To run the tests, do:
pytest --ckan-ini=test.ini
License
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ckanext_auth-0.4.1.tar.gz.
File metadata
- Download URL: ckanext_auth-0.4.1.tar.gz
- Upload date:
- Size: 41.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e658162c1718a275cc750353df653243e3708eeaa7d56e924a007c4237398a19
|
|
| MD5 |
90f88a690a6fe594c3b2bfb365b38779
|
|
| BLAKE2b-256 |
281c522327cff6b258bc2b8b561db7db51dc39bfecd8efc5efdcafb9fcbe92ee
|
File details
Details for the file ckanext_auth-0.4.1-py3-none-any.whl.
File metadata
- Download URL: ckanext_auth-0.4.1-py3-none-any.whl
- Upload date:
- Size: 47.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1ad35d15e99e58fb02892354f066a324669bda19701e9b334dfb3c1e705b1e3
|
|
| MD5 |
9ee65d7f211d0ad3f8a3a98277a318bc
|
|
| BLAKE2b-256 |
13754d636a76f6a7fba377a9369af9505407effdc52b6511e47019d463967d6c
|