Skip to main content

Tests

ckanext-oidc-pkce

OpenID connect with PKCE flow authenticator for CKAN.

Warning Developed for Okta and not tested with other providers. PRs or feature-requests are welcome

The plugin adds an extra route to CKAN allowing login through an external application. This route available at /user/login/oidc-pkce(oid_pkce.login endpoint). Original authentication system from CKAN is unchanged and it's up to you(or another extension) to hide original login page if only SSO accounts are allowed on the portal.

Requirements

Compatibility with core CKAN versions:

CKAN version Compatible?
2.9 yes
2.10 yes

Installation

  1. Install the package

    pip install ckanext-oidc-pkce
    
  2. Add oidc_pkce to the ckan.plugins setting in your CKAN config file

  3. Add SSO settings(refer config settings section for details)

Config settings

# URL of SSO application
# Could be overriden at runtime with env var CKANEXT_OIDC_PKCE_BASE_URL
ckanext.oidc_pkce.base_url = https://12345.example.okta.com

# ClientID of SSO application
# Could be overriden at runtime with env var CKANEXT_OIDC_PKCE_CLIENT_ID
ckanext.oidc_pkce.client_id = clientid

# ClientSecret of SSO application
# (optional, only need id Client App defines a secret, default: "")
# Could be overriden at runtime with env var CKANEXT_OIDC_PKCE_CLIENT_SECRET
ckanext.oidc_pkce.client_secret = clientsecret

# Path to the authorization endpont inside SSO application
# (optional, default: /oauth2/default/v1/authorize)
ckanext.oidc_pkce.auth_path = /auth

# Path to the token endpont inside SSO application
# (optional, default: /oauth2/default/v1/token)
ckanext.oidc_pkce.token_path = /token

# Path to the userinfo endpont inside SSO application
# (optional, default: /oauth2/default/v1/userinfo)
ckanext.oidc_pkce.userinfo_path = /userinfo

# Path to the authentication response handler inside CKAN application
# (optional, default: /user/login/oidc-pkce/callback)
ckanext.oidc_pkce.redirect_path = /local/oidc/handler

# URL to redirect user in case of failed login attempt.  When empty(default)
# redirects to `came_from` URL parameter if availabe or to CKAN login page
# otherwise.
# (optional, default: )
ckanext.oidc_pkce.error_redirect = /user/register

# Scope of the authorization token. The plugin expects at least `sub`,
# `email` and `name` attributes.
# (optional, default: openid email profile)
ckanext.oidc_pkce.scope = email

# For newly created CKAN users use the same ID as one from SSO application
# (optional, default: false)
ckanext.oidc_pkce.use_same_id = true

# When connecting to an existing(non-sso) account, override user's password
# so that it becomes impossible to login using CKAN authentication system.
# Enable this flag if you want to force SSO-logins for all users that once
# used SSO-login.
# (optional, default: false)
ckanext.oidc_pkce.munge_password = true

License

AGPL

Release files for ckanext-oidc-pkce 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ckanext-oidc-pkce 0.4.1
File Size Uploaded
ckanext_oidc_pkce-0.4.1.tar.gz 25.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ckanext-oidc-pkce 0.4.1
File Interpreter ABI Platform
ckanext_oidc_pkce-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size:52.5 kB

Release files / ckanext_oidc_pkce-0.4.1.tar.gz

Download URL ckanext_oidc_pkce-0.4.1.tar.gz
Size 25.6 kB
Tags Source
SHA-256 checksum
How to use checksums
00da7dd69e2f10ba633176f5352cdd82f2aac4e26b9f8c068c99c65cb7760ac6
BLAKE2b-256 checksum
How to use checksums
1c93bbd92879523a3a38d3de3b333c2ebd9cf96b5c9c6444776f56a83a87d547
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / ckanext_oidc_pkce-0.4.1-py3-none-any.whl

Download URL ckanext_oidc_pkce-0.4.1-py3-none-any.whl
Size 26.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cf2235b64c9ba9f04d02f70719520857393b8dba5a05acbb0c67dd819bc401fc
BLAKE2b-256 checksum
How to use checksums
3a519f36887977dbdfda9bba25e11366eb4ab42feb498f2ed6073b942d604812
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page