Whenever we configure Identity Provider in KeyCloak, it automatically sets Redirect URI like
http://keyclaok:8080/auth/realms/{MY_REALM}/broker/google/endpoint
I am implementing multi-tenancy in the project. For every tenant, I will have a separate realm and in turn, have a separate Redirect URI.
For this to work, I need to configure the same URL in "Authorized Redirect URLs" in Google Cloud Platform Console.
To ensure KeyCloak's IDP Redirect URI and Google console's configured Authorized URL match, there are 2 possible options
- Dynamically(programmatically) configure Authorized Redirect URL in Google console when new tenant/realm is created. As far as I know, there is no way to dynamically set this authorized redirect URL. So this doesn't look like a viable option.
- Configure custom redirect URI in KeyCloak. However, Keycloak doesn't seem to allow changing Redirect URI for Identity Provider.
Any solution, workaround or hints would be appreciated. I feel this is not a unique problem that I am solving. It must be already done and solved by many.