Skip to main content

CKAN OIDC authenticator with PKCE flow

Project description

ckanext-oidc-pkce

OpenID connect with PKCE flow implementation 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 not yet

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
ckanext.oidc_pkce.base_url = https://12345.example.okta.com

# ClientID of SSO application
ckanext.oidc_pkce.client_id = clientid

# 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: none).
ckanext.oidc_pkce.error_redirect

# 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 openid

# 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

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-oidc-pkce-0.1.2.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

ckanext_oidc_pkce-0.1.2-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

Details for the file ckanext-oidc-pkce-0.1.2.tar.gz.

File metadata

  • Download URL: ckanext-oidc-pkce-0.1.2.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for ckanext-oidc-pkce-0.1.2.tar.gz
Algorithm Hash digest
SHA256 52d71016368ca288ae6b911d7ba70fcb0627308213f12e89242da8ba22a26d7d
MD5 e53c8518f7e49ba3d285dd9ed86b5bce
BLAKE2b-256 2b1b8eb6eeefa8e1b091f31a072e78b2424b6f16a5e8b78af1858c59047bf75a

See more details on using hashes here.

File details

Details for the file ckanext_oidc_pkce-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for ckanext_oidc_pkce-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4ec0b8d29026795715bf26e47ee3b2b7b3352877f88f7a557c3975414da143ff
MD5 478d1b118dfd6deccb8022652e47dfe0
BLAKE2b-256 2ce2eea522467ed8b53ce3968fca18173a9424e68158601b1bd66ee49935807c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page