Skip to content

Conversation

martin-ducar-gd
Copy link

Consider scenario:

  • k8s contains multi tenant micro services 1 service handling N tenants
  • keycloak is also mutli tenant but segregation is done on realm level
  • With current audience modifications for each relam/tenant the solution is pretty cumbersome (mountpoint per tenant if N >50 it gets messy plus restart of micro services on tenant CRUD)

Solution:

On K8s the issuer and audience is same as well as JWK.
Conditionally to allow another audience from k8s if specified in client attribute. Also risk is minimal as what we are doing is basically token exchange of k8s token (only auth than droped) and client from keycloak is than used (audience is correct at that moment).

FYI
Current main is broken since update to 26.4.0 of keycloak, needs a bit of refactor as Validate token vs ClientAuthenticator changed in keycloak, this MR is for 26.3.* versions

on K8s the issuer and audience is same as well as JWK.
Allow conditionally to allow another issuer from k8s if
multi tenancy use-case is needed (multiple realms as tenants,
one k8s SA as client to access those realms).
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

Successfully merging this pull request may close these issues.

1 participant