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.10+

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.5.tar.gz (41.6 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.5-py3-none-any.whl (47.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ckanext_auth-0.4.5.tar.gz
  • Upload date:
  • Size: 41.6 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.5.tar.gz
Algorithm Hash digest
SHA256 91afe33221ab632ab526f99641f1298ca0540e542970858723361ef922cc9637
MD5 22163ebf3b32b0f51a56867fa5823bec
BLAKE2b-256 41e0027bbd48c2889f4472f50bae93b7cbf8f1ac097ae30b6b551f5f5363d830

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ckanext_auth-0.4.5-py3-none-any.whl
  • Upload date:
  • Size: 47.2 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3b1a9311f37a5fc1d83608addd23b5271ac7728b22c27c960b013401db1bcd9c
MD5 6260dbcab44af26133be5c0c21e86373
BLAKE2b-256 9663374b7343ca15d212ca83bee111a806a99e9acbff159da9258c120b87c50f

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