Fast API for routing to Streamlit App

I have made a few streamlit apps and am running them on a linux server in docker containers. I want to develop a landing page of sorts that authenticates a user and then shows them the apps they have access to.

The basic logic is as follows:
User navigates to myserver
They get proxied by NGINX to a Fast API landing page
In FastAPI if they are logged in they see what streamlit apps they have access to and can navigate to them
Else they are authenticated against a DB and then shown apps they have access to and then navigate to them.

I can’t get the navigation piece to work. Like how do I route a user to a streamlit app without redirecting them entirely to a different page. I have been looking at mounting the streamlit app, requesting it using websockets or embedding it using iframes in html. As of right now I can only get the iframes to work.

Any ideas or links would be a great help! Thanks

What we’ve done is add authentication into our Streamlit app using the new methods that give access to HTTP headers, with authentication handled by a proxy that adds user details as headers.

So the proxy handles the authentication before forwarding the request to Streamlit, and our app uses the headers to identify the user and work out which “views” are appropriate for them. Each view is a separate module that gets rendered when selected by the user (we did this before multi-page apps were a thing).

I use st.context to get a cookie with login info and that handles authentication. The authentication is handled using fastapi and then users can navigate to the streamlit apps they have access to from a home page. I am still iframing my streamlit apps into an html template with a html navigation bar so users can navigate between multiple apps.

It works pretty well but would still love native rerouting in streamlit