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.4.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.4-py3-none-any.whl (47.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ckanext_auth-0.4.4.tar.gz
  • Upload date:
  • Size: 41.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for ckanext_auth-0.4.4.tar.gz
Algorithm Hash digest
SHA256 b5fffaa95a3e5fcc50cd5a0b0c992aaf15e71faddc20d8405836873f1b862e24
MD5 e3f6d033138c23a19036428c1e2c3017
BLAKE2b-256 50de2a0044af522a7baf7b962a3f83d86dd945e406b79bfb77f07d39a0e448ef

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ckanext_auth-0.4.4-py3-none-any.whl
  • Upload date:
  • Size: 47.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for ckanext_auth-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9ca114ce082594641cbe92cfb16421a9974650a413bcc72ff9aabce14f30f928
MD5 d0449f8f17de16dd75eae95d72bdb153
BLAKE2b-256 93a954103a0f6975ab3a2b4a0a9da4e17f91daff5b84ed87a22ef5fd5872083d

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