Does WebappImpersonationContext work for Streamlit?
![Emiel](https://us.v-cdn.net/6038231/uploads/Dataiku/nAvatar14.png)
Emiel
Registered, Frontrunner 2022 Finalist, Dataiku Frontrunner Awards 2021 Participant, Frontrunner 2022 Participant Posts: 22 ✭✭✭✭✭
I tried using WebappImpersonationContext in a Streamlit web app but it doesn't work. It doesn't change the user at all. Am I doing something wrong, or is this not supported yet?
Answers
-
Emiel Registered, Frontrunner 2022 Finalist, Dataiku Frontrunner Awards 2021 Participant, Frontrunner 2022 Participant Posts: 22 ✭✭✭✭✭
I bypassed it with the following code, but it would be helpful if the function would work.
auth_info_brower = dataiku.api_client().get_auth_info_from_browser_headers(_get_websocket_headers())
user_id = auth_info_brower["authIdentifier"]
user = dataiku.api_client().get_user(user_id)
client_as_user = user.get_client_as()
project = client_as_user.get_project(project_name)
datasetapi = project.get_dataset(dataset_name)