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
- Function for long running task (other 60...
My function need long running other 60 seconds. But async mode return empty body. How to deal with that please ?
- OAuth2 Provider is disabled automaticall...
Hi everyone, I'm using self-host Appwrite 1.7.4. I can setup OAuth2 with Google successfully, however the provider is disabled automatically after one day witho...
- Disabling registration
Is it possible to disable registration in self hosted ?