Passing authenticated user into Superset iFrame with Keycloak #33151
Replies: 1 comment 4 replies
-
To achieve your goal of embedding the entire Superset frontend in an iframe without encountering the Superset or Keycloak login pages, and to map Keycloak users to specific Superset roles, you can follow these steps:
By following these steps, you should be able to embed the Superset frontend in your SvelteKit application without encountering login pages, while also controlling access to dashboards based on user roles. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other |
Beta Was this translation helpful? Give feedback.
-
Hello,
I use KeyCloak as my auth provider, and as such implemented the required changes to my local Superset repo by adjusting the
superset_config.py
, and addingclient_secret.json
andkeycloak_security_manager.py
, as explained in the docs and also this arcticle.Now when I
docker compose up
thedocker-compose.yml
and access the superset frontend from its default8088
port, I indeed get the Keycloak Login page instead of Superset's, and can login and see my dashboards with theGemma
role.I also have a
SvelteKit
based frontend project, in which I would like to embed the entire Superset frontend as an iframe. In this case I do not want to embed a specific dashboard (hence embedded-sdk is not useful to me), but rather I would like the embedded iframe to include the entire/welcome/home
route, so the user can navigate between multiple dashboards potentially.I also authenticate to this frontend using
keycloak-js
, and am able to get an authenticated token. My problem is now that I need to pass the user that authenticated through my frontend, so that when I navigate to the page with the superset iframe, I wouldn't see neither superset's native login page, or the Keycloak login page since the user has already logged in from my frontend. Later on I want to map keycloak users to specific superset roles, such that I can configure which dashboards can be seen by which users. How can I do that?I was initially passing the jwt
guest token
that I generate in the frontend using the sameGUEST_TOKEN_JWT_SECRET
as I have in the Superset config in various ways. So for example the url that the iframe receives was:but would this work now that I do not have a guest login but rather login through keycloak? And that I also want to be able to see a list of dashboards, not just one.
Thank you :)
Beta Was this translation helpful? Give feedback.
All reactions