Does WebappImpersonationContext work for Streamlit?

Emiel_Veersma
Level 3
Does WebappImpersonationContext work for Streamlit?

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?

0 Kudos
1 Reply
Emiel_Veersma
Level 3
Author

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)

 

0 Kudos