Skip to main content
Version: 1.4.0

Example OIDC Setup: Keycloak

OIDC client for the backend

The back-end needs to be configured as an OIDC client so that developers can authenticate against it to receive service accounts for App Clusters to connect to the data services.

Create a new client for the backend. In our example we call the client kube-bind-backend.

step 1

Enable Client authentication and Authorization, so that Keycloak users can authenticate against the backend. Select all the flows you want to enable. For the web based setup Standard Flow is required.

step 2

Set up Root and Home URLs as required. For Valid redirect URLs please add <BACKEND_URL>/callback. Replacing <BACKEND_URL> with the base URL of the backend.

step 3

OIDC setting for Users

Currently no special setup is required for users. All users in keycloak can create a binding.

OIDC client for helper CLI

To create bindings non-interactively you need to create an account for the helper CLI.

Click on Create client

step 4

Create a new client. You can give it a name of your choice. In this example we will pick "cli-client" This name will be the value of the OIDC_CLIENT_ID environment variable for the helper CLI.

step 5

Enable Client authentication and the Service accounts roles Authentication flow. This will enable the helper CLI to generate tokens for authenticating to the backend.

step 6

Fill out the Login settings if needed, in this example we leave the fields empty.

step 7

Click on the dedicated client scope for the newly created client.

step 8

Click on Add mapper > By configuration.

step 10

Configure a new mapper and select type Audience.

step 11

Map the Audience of the client you created for the backend, and enable Add to ID token and Add to access token.

step 12