from streamlit_server_state import server
from streamlit.runtime.scriptrunner.script_run_context import get_script_run_ctx
then this code retrieves the current server and session_info, from which I am able to extract the http headers (which I need for authentication)
# The container can host multiple sessions, so we must make sure to select the correct one!
session_id = get_script_run_ctx().session_id
session_info = server.get_current_server()._get_session_info(session_id)
session_headers = session_info.client.request.headers._dict
I have to say this looks worse than it did in the previous streamlit version, and it looked bad enough before. We really need a non-hacky way of getting to this information, it feels like it will break with every upgrade. Maybe there is a way! does anyone know?