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.1.tar.gz (41.5 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.1-py3-none-any.whl (47.0 kB view details)

Uploaded Python 3

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

Hashes for ckanext_auth-0.4.1.tar.gz
Algorithm Hash digest
SHA256 e658162c1718a275cc750353df653243e3708eeaa7d56e924a007c4237398a19
MD5 90f88a690a6fe594c3b2bfb365b38779
BLAKE2b-256 281c522327cff6b258bc2b8b561db7db51dc39bfecd8efc5efdcafb9fcbe92ee

See more details on using hashes here.

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

Hashes for ckanext_auth-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e1ad35d15e99e58fb02892354f066a324669bda19701e9b334dfb3c1e705b1e3
MD5 9ee65d7f211d0ad3f8a3a98277a318bc
BLAKE2b-256 13754d636a76f6a7fba377a9369af9505407effdc52b6511e47019d463967d6c

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