Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support client authentication via private key jwt #1023

Open
thomasdarimont opened this issue Nov 28, 2024 · 1 comment
Open

Support client authentication via private key jwt #1023

thomasdarimont opened this issue Nov 28, 2024 · 1 comment

Comments

@thomasdarimont
Copy link
Contributor

Description

Add support for client authentication via "client_assertion_type": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer" and a proper client JWT send as "client_assertion".

Discussion

No response

Motivation

IMHO using a dedicated client with client_credentials grant and proper service account roles for managing the realm configurations is the best way to go. Unfortunately the current version of the terraform provider only supports client authentication via client secret, as shown here: https://github.com/keycloak/terraform-provider-keycloak/blob/master/keycloak/keycloak_client.go#L261

To improve security we could also support for authentication via private key JWT via "client_assertion_type": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer" and a proper client JWT send as "client_assertion".
We would then configure "private key jwt" as auth method for the client and add configure the client certificate in the client JWKS configuration.

Details

client_assertion_type, private key and certificate should be provided as configuration parameters.

@thomasdarimont thomasdarimont changed the title Support authentication via private key jwt Support client authentication via private key jwt Nov 28, 2024
@mauriceackel
Copy link

It should also be possible to directly provide a client assertion and skip the private key setup.

This would allow users to easily use workload identity. The use case is the following:

  1. Terraform running in pipeline and authenticated with google cloud service account
  2. Using the google cloud sdk, get a signed client assertion (signed by the google service account)
  3. Use this assertion to authenticate with keycloak

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants