fix(keycloak): allow the polaris-console redirect URI on any project - #47
fix(keycloak): allow the polaris-console redirect URI on any project#47abir-oumghar wants to merge 1 commit into
Conversation
|
there is conflict issue here. can you make sure you switched to the main branch and then fetched and merged the upstream main and then rebase your feature branch on top of main one ? I think that will solve the issue |
|
This PR should be displaced to okdp-sandbox |
|
As discussed and aggreed in the friday contributors meeting, |
Here it does not touch the Keycloak kubocd package but the default context |
Oh ok got it |
|
Tried that first, it does not work. The Keycloak realm is rendered once by the keycloak release, which does not know the project namespaces created later. And in practice the keycloak package only substitutes {{ .Context.ingress.suffix }} in redirectUris (packages/system/keycloak/keycloak.yaml, line 206), never the namespace placeholder. Rendering the package with your value gives: https://polaris-console-.okdp.sandbox/auth/callback The trailing wildcard is the only form Keycloak accepts here: a scoped pattern like https://polaris-console-*.{{ .Context.ingress.suffix }}/auth/callback is rejected for every URL, legitimate ones included, since Keycloak only supports the wildcard at the end of the URI.
|
|
Agreed on moving this to okdp-sandbox, the same file carries the same value there. I will open it against that repo and close this one. |
Description
The
polaris-consoleOIDC client hardcodes the project namespacedefaultin its redirect URI, so the console login fails withInvalid parameter: redirect_urion every project named otherwise. The console is deployed per project, so its host carries the project namespace.This replaces the hardcoded host with
https://polaris-console-*, which matches the console of any project. Keycloak only supports a trailing wildcard, so the domain scoped patternhttps://polaris-console-*.<suffix>/auth/callbackis not usable: it is rejected for every URL, legitimate ones included. The chosen pattern is still narrower than thehttps://*already used by the seven other per-project clients in this file.Related Issue
Fixes OKDP/okdp-sandbox#82
Type of Change
How to Test
Deploy Polaris in a project namespace other than
default, then openhttps://polaris-console-<project>.<suffix>and log in.Verified on an OKDP sandbox (kind, Keycloak 26.1.3) with the project
examples:https://polaris-console-examples.<suffix>/auth/callbackand serves the login formAccess-Control-Allow-Originfor the console origin, on several project nameshttps://evil.example.comandhttps://superset-<project>.<suffix>are still rejectedImpact is limited to the console UI login. The Polaris REST API is unaffected: Trino queries on the Polaris backed catalogs keep working with the hardcoded value in place.
Note: any static wildcard stays permissive, a host like
polaris-console-<something>.example.comwould also match. Registering the client per project at deploy time, where the exact host is known, remains the proper fix.Checklist