I read in the appwrite realtime docs that there is no support for real-time on the server side at the moment. But I need a way to proxy realtime connections for my use ise case.
Basically, I'm looking to use an external Auth service, and the server side APIs to do custom authentication for the endpoints from the client (by disabling direct client side access to the appwrite servics). But for realtime, that doesn't seem to be feasible since it's not possible to connect to the realtime endpoint via API keys. What can I do in this case?
i'm not sure if you can actually use the realtime api if you're not using appwrite's authentication 🧐 how would you restrict access to certain resources client side?
For server-side, we usually use Appwrite Functions or Webhooks
All of the restrictions are done in custom code. All of the appwrite endpoints are proxied, and client side access is disabled for the services. To access any resource on the client, the client reaches out to the proxy which uses API keys to access the resource on the server directly and it does authentication as needed.
That's how it works
I'm still using Appwrite format though. The Permission and Role objects are still used to generate permissions, and the $permissions property is what's read to determine access rights.
But I do understand that while this works fine for other APIs, doing the same with realtime might not be ideal. So,...
Permissions are ignored when using API key though 🧐
Yes I know
And that's what I'm taking advantage of
I'm doing the permission check myself and return 401 error when needed, else I'll fetch the resource and send to the client
Ya so since you're doing everything yourself server-side, you won't be able to use our realtime API. You'd have to set up your own websockets and then maybe you can use webhooks to get notified of when to push data through your websocket
Fine, but not cool lol 😆
Thanks
Recommended threads
- "Domain verification failed"
"Domain verification failed" I was install Appwrite in my VDS server. I using Coolify for install Appwrite. After install complete, i want add my domain, and i ...
- Appwrite Sites triggers builds for all p...
I connected my Appwrite Sites to my Git app on my self hosted Appwrite server, but even though I only connected it to main branch, it creates a build every sing...
- Scheduled works locking the entire Maria...
I have a scheduled function and apparently that or something is locking the entire MariaDB database and Appwrite is giving MariaDB errors. This error persists e...