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 is available at /user/login/oidc-pkce(oidc_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 | last tested on 0.4.1 |
| 2.10 | yes |
| 2.11 | yes |
| 2.12 | yes |
Installation
-
Install the package
pip install ckanext-oidc-pkce
-
Add
oidc_pkceto theckan.pluginssetting in your CKAN config file -
Add SSO settings(refer config settings section for details)
Config settings
# URL of SSO application
# Could be overridden 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 overridden at runtime with env var CKANEXT_OIDC_PKCE_CLIENT_ID
ckanext.oidc_pkce.client_id = clientid
# ClientSecret of SSO application
# (optional, only need id if Client App defines a secret, default: "")
# Could be overridden at runtime with env var CKANEXT_OIDC_PKCE_CLIENT_SECRET
ckanext.oidc_pkce.client_secret = clientsecret
# Path to the authorization endpoint inside SSO application
# (optional, default: /oauth2/default/v1/authorize)
ckanext.oidc_pkce.auth_path = /auth
# Path to the token endpoint inside SSO application
# (optional, default: /oauth2/default/v1/token)
ckanext.oidc_pkce.token_path = /token
# Path to the userinfo endpoint 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 available
# 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
# Whether newly created CKAN users will use the same ID as the one
# from the 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 log in using CKAN authentication system.
# Enable this flag if you want to force SSO logins for all accounts
# that have SSO.
# Does not apply to sysadmins (as they need to know their passwords in order
# to update user profiles).
# (optional, default: false)
ckanext.oidc_pkce.munge_password = true
License
Metadata
Release files for ckanext-oidc-pkce 0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ckanext_oidc_pkce-0.4.2.tar.gz | 27.0 kB | Without provenance | Details for ckanext_oidc_pkce-0.4.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ckanext_oidc_pkce-0.4.2-py3-none-any.whl | Python 3 | none | any | Details for ckanext_oidc_pkce-0.4.2-py3-none-any.whl |
Total release size: 55.2 kB
Release files / ckanext_oidc_pkce-0.4.2.tar.gz
| Download URL | ckanext_oidc_pkce-0.4.2.tar.gz |
|---|---|
| Size | 27.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cab02fae4dd0677a7d4e6840a649db716d33c7412a17bad16c6f68515d74754b
|
|
BLAKE2b-256 checksum How to use checksums |
0ce3cf3efce59a227e001088a8c8bfd07b11e024a0ee1c2d3ac5f7c9d03d8d4b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / ckanext_oidc_pkce-0.4.2-py3-none-any.whl
| Download URL | ckanext_oidc_pkce-0.4.2-py3-none-any.whl |
|---|---|
| Size | 28.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2b0915adf1a20f25087fd5149b990c549ac2dde737c3932484422f770708b556
|
|
BLAKE2b-256 checksum How to use checksums |
48e2ba4e65f8313bba3795ba26f550a75822ab3deace708e116c62563b37074d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Security for ckanext-oidc-pkce 0.4.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.