
Hey awesome community!
I'm trying to build an application where on the server side I have both Appwrite and a FastAPI service. I'd like each request on the FastAPI service to be authenticated through Appwrite (all routes are user-authenticated).
I read this doc: https://appwrite.io/docs/authentication-server, and my questions are:
- whats the mechanism to "pass" the JWT token to the FastAPI service? are there any best practices around that? any working snippets (in any language..) would help - where a backend service basically "delegates" the authentication to appwrite.
- is this a feasible architecture with Appwrite? my main use-case is to avoid all the gory details of having to implement (yet again) authentication my self. so my assumption was that this should be simple.
- are there any alternatives way to achieve this?
if indeed I got through that path I'd be happy to contribute some code snippets to the docs. thx!

- Typically, stuff like this is passed in a header
- You can do this. In my opinion, it's a little complicated to have an extra back end server.
- 1 alternative is similar to how to handle server side rendering: proxy login API calls through your fast API proxy, capture the session cookie, and then store it in session so it can be used later

What do you need your fast API server for anyways?

It is going to use a customized DB for CRUD but also manipulating data. there is some "deep" logic there which I believe won't fit into simple cloud functions

regarding 2 - this is not a common pattern for appwrite? usually its the "only" Backend in applications?

Yes, the usual scenario is to connect your front end app directly to Appwrite. Any special logic would go into an Appwrite Function

What's the deep logic that wouldn't fit into an Appwrite Function?

External API calls to various services, some other specific services (for statistical calculation), maybe fetching some data from batch jobs, etc.

you think that would fit an appwrite function?
it sounds "all or nothing"

This sounds like it would work in an appwrite function

You can go with your route...it's just more work since there's this extra layer you need to manage
Recommended threads
- API Endpoint to Verify Password.
I have 2 use cases where i need to verify a users password outside of login, e.g. Updating user account data (such as name, or prefs, or data in a users databa...
- Corrupted files on AWS S3
Hello! I'm having trouble using S3 storage with appwrite for file uploads. It happens when uploading files from the Javascript SDK or from the console. The fi...
- 500 server error
Pretty please.. trying to run the last 1.7.4 version on a coolify instance.. i searched like everywhere.. i changed the console to 6.0.41 too.. i tried to hardc...
