Skip to content
Discussion options

You must be logged in to vote

I have never used Flask-appbuilder, but from your code, I see it uses g, the global thread local proxy object from Flask.

I imagine Flask-appbuilder sets the "current user" in it, but I don't know how. It probably reads authentication details from a cookie, a JWT token, or some other specific method, then it probably verifies it, extracts some ID, and gets the user record from the DB with that ID. Or something similar.

FastAPI doesn't make any compromise on which DB, ORM, nor specific authentication method you use, but you can integrate anything you want.

In FastAPI there are no global proxy objects, you access the data directly. To get the current user you would probably read the cookie,…

Replies: 6 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by YuriiMotov
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@wangxin688
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem question-migrate
5 participants
Converted from issue

This discussion was converted from issue #1257 on February 28, 2023 09:50.