File uploader on azure webapp - 403 Axios Error

All the other posts on the forum seem to suggest to just turn off CORS and XSRF.
st.file_uploader with Azure Active Directory - error 403 [August 2023] - :rocket: Deployment - Streamlit
AxiosError: Request failed with status code 403 - :balloon: Using Streamlit - Streamlit
Isn’t there a better way?