Workaround for IdPs with one callback URL per OAuth Client (prod + preview) — second provider not working as expected

Hi everyone,

My IdP (OIDC) only allows one callback URL per OAuth Client. Since my app has two environments — a published/production domain and the Baserow-hosted Preview URL — I can’t register both callbacks on a single Client. So I created a second OAuth Client on the IdP side (with its own callback pointing to the Preview URL) and added it as a second OIDC provider in my Baserow User Source.

Result:

  • Production (using the first provider/Client): login works perfectly.
  • Preview (expected to use the second provider/Client): I get an OAuth error.

What I suspect but haven’t confirmed: the Login Element doesn’t actually switch between the two configured providers based on preview vs. published context — it may always use the same one (first configured / default), so my second provider is never invoked, and the auth request goes out with the production callback URL regardless of which environment I’m testing in.

Question: Is there a supported way to have a User Source use different OIDC providers/callback URLs depending on preview vs. published context? Or is a User Source always tied to a single active provider regardless of environment?

Happy to share the exact redirect_uri sent during the failed preview request if that helps debug.

Thanks!