Backward-compatible multi-tenant Keycloak integration - preserving previous token endpoint #12940
Replies: 1 comment
-
|
APISIX does not natively support dynamic routing to different Keycloak realms at a shared To achieve backward-compatible multi-tenant Keycloak integration, you need a custom APISIX plugin. This plugin should:
This approach preserves the For implementation, you can use the plugin development guide and refer to the proxy-rewrite plugin as an example of how to set the upstream URI. The mapping logic and error handling will be specific to your tenant/client setup. If custom plugin development is not feasible, the only alternatives are to use an external proxy in front of APISIX or to chain gateways, but these add operational complexity. Let me know if you want a sample Lua plugin skeleton or more details on mapping strategies. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Background:
Migrating from WSO2 APIM (single endpoint /oauth2/token) to APISIX + multi-tenant Keycloak where each tenant has separate realms (/realms/{realm}/protocol/openid-connect/token).
Hard Requirement:
Must preserve /oauth2/token endpoint for backward compatibility - cannot change client integrations.
Multi-tenant Setup:
Client A → dev-box realm
Client B → qa-box realm
Client C → prod-box realm
Challenge:
How does APISIX determine which Keycloak realm to route to when all clients hit the same /oauth2/token endpoint?
Beta Was this translation helpful? Give feedback.
All reactions