Demonstrating Proof-of-Possession (DPoP)v1.0+

Configure the OpenID Connect plugin for Demonstrating Proof-of-Possession by using the proof_of_possession_dpop configuration option.

Here’s how DPoP works:

sequenceDiagram
    autonumber
    participant client as Client <br>(e.g. mobile app)
    participant kong as Gateway
    participant upstream as Upstream <br>(backend service,<br> e.g. httpbin)
    participant idp as Authentication Server <br>(e.g. Keycloak)
    activate client
    client->>client: generate key pair
    client->>idp: POST /oauth2/token<br>DPoP:$PROOF
    deactivate client
    activate idp
    idp-->>client: DPoP bound access token ($AT)
    activate client
    deactivate idp
    client->>kong: GET https://example.com/resource<br>Authorization: DPoP $AT<br>DPoP: $PROOF
    activate kong
    deactivate client
    kong->>kong: validate $AT and $PROOF
    kong->>upstream: proxied request <br> GET https://example.com/resource<br>Authorization: Bearer $AT
    deactivate kong
    activate upstream
    upstream-->>kong: upstream response
    deactivate upstream
    activate kong
    kong-->>client: response
    deactivate kong

This method binds the access token to a JSON Web Key (JWK) provided by the client.

Prerequisites

  • A configured identity provider (IdP) with DPoP enabled

Environment variables

  • ISSUER: The well-known issuer endpoint of your IdP, for example http://keycloak.test:8080/realms/master.

  • CLIENT_ID: The client ID that the plugin uses when it calls authenticated endpoints of the IdP.

  • CLIENT_SECRET: The client secret needed to connect to your IdP.

  • TOKEN_SALT: A random string that decK requires (v1.59 and later) so session credentials aren’t regenerated on every sync. This parameter is optional for other formats. For example, generate one with openssl rand -base64 16.

Set up the plugin

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!