Assistance needed: Quarkus OIDC multitenancy with Keycloak #49603
Unanswered
roman-galyaminskiy
asked this question in
Q&A
Replies: 2 comments 2 replies
-
/cc @pedroigor (keycloak,oidc), @sberyozkin (keycloak,oidc) |
Beta Was this translation helpful? Give feedback.
0 replies
-
@roman-galyaminskiy Thanks for the detailed description, so, when using I'm not sure Quarkus can help here. May be you can get a more specific feedback in the Keycloak GitHub Discussions ? @pedroigor Pedro, do you have some hints ? Thanks |
Beta Was this translation helpful? Give feedback.
2 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.
-
We have multiple tenants each accessing the app from its URL (ex: https://tenant1.myapp.net). To support multitenant setup in Keycloak (via organizations, not realms), we are using TenantConfigResolver:
Internal Keycloak URL for
auth-server-url
:And matching public URLs to prevent "Issuer (iss) claim value doesn't match expected value":
Using these two properties allows us to use the internal URL for cross-service communications within the cluster - that's great!
However, we are also using Keycloak for authorization, utilizing the Quarkus Keycloak authorization client. The problem is that here we cannot use the internal URL, since according to Keycloak docs, dynamic frontend and backend URLs are mutually exclusive:
Keycloak config:
Setting
auth-server-url
to the internal URL results in{"error":"invalid_grant","error_description":"Invalid bearer token"}
when attempting authorization.The only way we managed to make it work was to use tenant-specific public URLs for
auth-server-url
. But this forces us to use public URLs within the cluster, which seems non-optimal.Questions:
Is this a valid approach? Is there a Quarkus OIDC configuration option that would allow using the internal URL for authorization as well, or is relying on public URLs the only supported way?
Versions:
Quarkus: 3.18.4
Keycloak: 26.0.5
Beta Was this translation helpful? Give feedback.
All reactions