CKAN OIDC authenticator with PKCE flow
Project description
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
-
Install the package
pip install ckanext-oidc-pkce
-
Add
oidc_pkce
to theckan.plugins
setting in your CKAN config file -
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ckanext_oidc_pkce-0.3.1.post1.tar.gz
.
File metadata
- Download URL: ckanext_oidc_pkce-0.3.1.post1.tar.gz
- Upload date:
- Size: 25.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f820688d9d037110cecea9b34a45a8704d7bad2ebf472f4817ec0172c9481c9 |
|
MD5 | 9155c864cb9221ef7def9deaf58693d5 |
|
BLAKE2b-256 | c6271564bcd56c6fdb870ee8da7c1ad028ab71f6199546ccf5c484a24fc3603c |
Provenance
File details
Details for the file ckanext_oidc_pkce-0.3.1.post1-py3-none-any.whl
.
File metadata
- Download URL: ckanext_oidc_pkce-0.3.1.post1-py3-none-any.whl
- Upload date:
- Size: 26.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3dad70c90711e599e372c7965c98510119747053750bc567ab1c12c1776e050 |
|
MD5 | 0a80df45ff730add25103966b92d37a0 |
|
BLAKE2b-256 | 8c59ec13e5a46f4433c0a2b3d95e2ba1c11c21ad3d010c5e31083c4a271fcd08 |