Switching Keycloak Realm based on subdomain

Viewed 468

We are using Keycloak as our authentication server behind an application server. The solution is multi-tenanted by the subdomain. We need to switch the realm automatically based on the subdomain.

Example when user visits,

  • abc.xyz.com/auth/ -> abc realm.
  • bcd.xyz.com/auth -> bcd realm.

This will allow us to unify the auth logic on all the other applications on the domain. any leads? We do have the capability of setting the realm as a header using our proxy.

cheers, Thanks in advance, Kaveen Rodigo

1 Answers

There was no clear and out-of the box solution for this. Instead what I opted was to use was the Landing Page (React APP) to take a look at the subdomain and re-write the realm accordingly.

Related