How to use this with a simple project #317
-
Supposing I'd want to build a simple fastapi api(e.g a post and comment app) and I need to relate the user that's authenticated by fief.dev to a post and comment how do I go about that? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hail, @Nneji123 👋 Welcome to Fief's kingdom! Our team will get back to you very soon to help. In the meantime, take a minute to star our repository ⭐️ Farewell! |
Beta Was this translation helpful? Give feedback.
-
You can refer to the following example: https://docs.fief.dev/integrate/python/fastapi/#api-example @app.get("/user")
async def get_user(
access_token_info: FiefAccessTokenInfo = Depends(auth.authenticated()),
):
return access_token_info
|
Beta Was this translation helpful? Give feedback.
You can refer to the following example: https://docs.fief.dev/integrate/python/fastapi/#api-example
FiefAccessTokenInfo
is a dictionary containing theid
key; which is the ID of the user in Fief. You can use this ID to reference the user in your app and data.