The fix was created after the 1.13.0 release. You will have to either wait for the next release on the 27th or try to see if the fix is available in streamlit-nightly.
The last option is to try workarounds described in this GitHub issue:
opened 06:59PM - 15 Aug 22 UTC
closed 06:34PM - 30 Sep 22 UTC
enhancement
### Problem
In previous versions, we used the following code to retrieve the … access token header from the websocket headers:
```python
from streamlit.server.server import Server
from streamlit.scriptrunner.script_run_context import get_script_run_ctx
def get_access_token() -> Optional[str]:
"""Gets the access token from the websocket headers, if possible."""
# Get headers
session_id = get_script_run_ctx().session_id # type: ignore
server = Server.get_current()
session_info = server._get_session_info(session_id)
if session_info.ws is None: # type: ignore
# At first page load, this is None (at least until #4099 is fixed)
st.markdown("Unable to get session websocket. Please refresh the page.")
st.stop()
headers = session_info.ws.request.headers # type: ignore
# Get access token
access_token_key = "X-Access-Token"
if access_token_key in headers.keys():
access_token = headers[access_token_key]
else: # development environment
access_token = None
return access_token
```
We noticed the import paths changed for scriptrunner and server, however `Server.get_current()` apparently no longer exists. Is there still a way for us to get the websocket headers?
This is very important for us, as we use the access token for group-based access control and there isn't another way for us to easily get the same information that we've been able to find.
Currently we've just pinned the version to 1.11.1 but that's not great long-term as we do like to take advantage of new features as they come out.
### Solution
**MVP:** Whatever is easiest for us to be able to get the access token from the websocket headers.
**Possible additions:** Potentially some documentation support for the server side of the app would be great.
But I would wait for the next release or check streamlit-nightly.