Skip to main content

"Open Forms extension to use Keycloak access tokens when requesting prefill data from external APIs."

Project description



Open Forms Extension, Keycloak token exchange

Build status Code quality checks black Coverage status

python-versions django-versions pypi-version

Open Forms extension to use Keycloak access tokens when requesting prefill data from external APIs.

1 Features

  • Signal receiver which extracts the Keycloak access token from the session and caches it.

  • Pre-request hook that adds a custom authentication class to the request kwargs.

  • Custom authentication class that performs the token exchange with Keycloak and adds the exchanged token to the Authorization header.

2 Installation


  • Python 3.7 or above

  • setuptools 30.3.0 or above

  • Django 3.2

3 Usage

For an explanation of this how this extension works, look at the Open Forms developer documentation.

To see how to build and distribute an image with this extension, look at the Open Forms documentation about building and distributing extensions.

4 Configuration

In the Open Forms Admin, go to Miscellaneous > Token exchange plugin configurations. Click on Add Token exchange plugin configuration and fill in the details:

  • Select the service for which you want the token authorisation to be performed.

  • Add the Keycloak audience.

Save the configuration.

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

open-forms-ext-token-exchange-0.3.0.tar.gz (7.7 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page