Does appwrite sent the correct Access-Control headers when authed with API key?
- 1
- Users
- Accounts
- Web
- Self Hosted

I'm trying to use external Auth with appwrite by proxying client side requests with custom API endpoints that verify tokens and the make the request on behalf of the client with API keys as explained here https://discord.com/channels/564160730845151244/1121753945593872455/1122409631034122270
I'm worried about something though. While I can read permission on resources before sending them to the client or returning 401 Unauthorized error, appwrite provides no way to read app info from the server even when authed with API key. I want to know if I can still rely on appwrite to send the correct Access-Control-Allow-Origin headers to be forwarded to the client/browser on this case. Or I should request that the users define the origins again (maybe with env variables) on the server and handle that myself.
Hope it's understandable.

Btw, I do know I'll have to make sure the Origin
header is set on the request object for this to work.

I'll like to maintain the CORS rules enforced by Appwrite

Hey 👋 CORS protect a hostname (domain). If your proxy is on different domain than Appwrite API, you would need to protect your proxy as well.
If you simply proxy Appwrite's response headers and your proxy lives on another domain, browser will (should) complain about CORS.
Make sense?

I don't really get you

Does that mean that appwrite still sends appropriate Access-Control-Allow-Origin header when authed via API key?
Anyway, I think this is what I should be doing; Since the proxy is meant to shield the client from direct access to the Appwrite API, the access control headers returned by Appwrite should not determine the access control headers I'll send to the client. I have to specify what access control headers I want to send to the client since the proxy's URL is what the client requests, not the Appwrite API URL. Do you think that makes sense?
Recommended threads
- phantom relationships appear on parent c...
i have this bug were my past deleted collection apears as relationship to my parent collection. when i try to delete that relationship from parent it gives me e...
- Attribute stuck on proccessing
i tried creating a new attribute butits stuck on proccessing,i did a hard refresh,cleared cache everything but still stuck on proccessing,also in my functions w...
- Properly contained appwrite main app can...
Hello! We tried to reinstall our main self-hosted appwrite with a new method but the main app 2 mins after launch throw this error: ```2025/06/22 16:16:14 s...
