Skip to main content

2FA authentication for CKAN

Project description

Tests

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.
  • Email

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:

  1. Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate
  1. Clone the source and install it on the virtualenv
git clone https://github.com/DataShades/ckanext-auth.git
cd ckanext-auth
pip install -e .
  1. Add auth to the ckan.plugins setting in your CKAN config file (by default the config file is located at /etc/ckan/default/ckan.ini).

  2. Apply database migrations:

ckan db upgrade
  1. 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

AGPL

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

ckanext_auth-0.4.0.tar.gz (41.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ckanext_auth-0.4.0-py3-none-any.whl (46.9 kB view details)

Uploaded Python 3

File details

Details for the file ckanext_auth-0.4.0.tar.gz.

File metadata

  • Download URL: ckanext_auth-0.4.0.tar.gz
  • Upload date:
  • Size: 41.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for ckanext_auth-0.4.0.tar.gz
Algorithm Hash digest
SHA256 945803fc134a2d96d0f6c577955e9f4e830ccf87e5a1f87fb3d21046d740e94d
MD5 c5a4ecbb21d7ed0c1074cdd919a929f6
BLAKE2b-256 295298df9dfdd7342e66f37a700e437da76582d85dd6e8ff3bd8f4b0cb22f0ef

See more details on using hashes here.

File details

Details for the file ckanext_auth-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: ckanext_auth-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 46.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for ckanext_auth-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b58fdf013e989f320e63017f551d7785ba2d8c7e3487d279498c24719f20be8
MD5 067136bf7f034925d0cb04257bd73053
BLAKE2b-256 551c3dd47774c2f9a2e4bcc3564d5cd975ccda83b1db2432005cad28424574c7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page