Replies: 1 comment
-
|
Just sharing my workaround. I created a middleware that resolves the tenant based on the subdomain, and I create the MCPAuth instance inside that middleware. Note that I can get the token from the tool declaration and use it to call external APIs. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm implementing an MCP server with OAuth authentication using Keycloak as the Identity Provider, and I need to support multi-tenancy where each tenant has its own Keycloak realm.
Context
In our architecture:
tenant-a,tenant-b)/{tenant}/mcp- My API identifies the tenant at runtime via a proxy.How Keycloak Multi-Tenancy Works
Keycloak implements multi-tenancy through realms, where each realm is a complete isolation unit containing:
URL Structure:
Example endpoints per realm:
Tenant A (realm:
company-a):Tenant B (realm:
company-b):Questions for the Community
I was thinking about creating a workaround using a custom provider that dynamically switches realms and changes the
authorization_servers. However, I’m not sure whether it’s possible to change theauthorization_serversproperty at runtime.Beta Was this translation helpful? Give feedback.
All reactions