Skip to main content

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

Project description

Version:
0.5.0
Source:

https://github.com/open-formulieren/open-forms-ext-token-exchange

Keywords:

Open Forms Extension, Keycloak token exchange

Build status Code quality checks Ruff 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

2.1 Requirements

  • Open Forms 3.3.0 or newer.

2.2 Install

uv pip install open-forms-ext-token-exchange

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.5.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

open_forms_ext_token_exchange-0.5.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file open_forms_ext_token_exchange-0.5.0.tar.gz.

File metadata

File hashes

Hashes for open_forms_ext_token_exchange-0.5.0.tar.gz
Algorithm Hash digest
SHA256 a94ec0040c2ee3bea5e8b1f1171044cfbade68444ed4f95d842fafac1fd16c95
MD5 62b8d504539f82b648bcedaa166e3cce
BLAKE2b-256 1658c19a25a99dcf443c57e119a99b4dd451cf0186a068d52a8e1f270e7cf3a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for open_forms_ext_token_exchange-0.5.0.tar.gz:

Publisher: ci.yaml on open-formulieren/open-forms-ext-token-exchange

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file open_forms_ext_token_exchange-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for open_forms_ext_token_exchange-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f565d73b1395ede57608f6bab8bfc3ecfa5ee9f4935a26688b92429a58213b85
MD5 0a84f47faf5cac6856b65653753ee02a
BLAKE2b-256 61e24590c617a8e80e472b8cdd22cf1cb68bc9931a62c3c946d1904f1c27a5d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for open_forms_ext_token_exchange-0.5.0-py3-none-any.whl:

Publisher: ci.yaml on open-formulieren/open-forms-ext-token-exchange

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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