I am currently deploying Marimo programatically via FastAPI and need to get access to the
user
object that is set on the
request
when inside of a Marimo cell.
I am following the examples that have been set in the docs here
https://docs.marimo.io/guides/deploying/programmatically/#authentication-middleware-example However the code that is shown in the examples, and anything else I have tried, all result in the
user
being a
starlette.authentication.SimpleUser object
. No matter how I implement the middleware or what I set the user object in the request to I get the same result inside the marimo cell.
This happens even with the example code mentioned in the docs. I have attached the following files:
- Screenshot of the marimo app's output
- main.py - Fast API app
- test.py - Marimo notebook app being run programatically
No matter what I do I cannot get the values set in
request.scope["user"]
to show up in the app when it is rendered. I have tried changing it from a dictionary (used in the examples) to a subclass of starlette's SimpleUser. None of it is passed through to the Marimo app.
Any insight into what I could be doing wrong would be appreciated.