I have a secondary server where I do some work can i check in that server that the request to that server is sent by a logged in Appwrite user
You could send the user's JWT token to your server
that expires in 15 min should I send a new JWT with each request
users sessions can last long
What is the recommended whay to work around it
What's your stack? Can you provide some more detail on your setup?
yeah I have an endpoint which makes videos and run some long running processes . I want to put it on my server so that I can use a GPU it is a Python Django backend I have everything else integrated in appwrite how can I check that the request to this long running endpoint is snt by appwrite user.
I user Python Django for ruuning the GPU servers on AWS.
Do you use your Django backend for anything else?
No
Is the original request coming from a client side SDK?
yes
In that case, you can just run a quick check from the client side and only send that request if the user is authenticated so the server wouldn't get this request from unauthenticated users. Then to retrieve the user, you can just use the users API on the server and get the user by ID:
users.get('[USER_ID]');
Basically, the auth check happens on the client. So you can take advantage of the long lasting session.
Steven's suggestion of a JWT would also should work. Just generate a JWT on each request and send it to verify auth status. The short lived token shouldn't be an issue.
I would just use the JWT
Generating a new JWT on each request is not a problem right
because checking if the user is authenticated from client and only sending the request I will have to keep my server endpoint unauthenticated which I can't do because using GPU so it can be expensive
How often will you be making these request?
at max 2-3 time/15 min
Just curious if its every couple of seconds or maybe only a few times a day per day
Per user?
yeah
Recommended threads
- Custom emails
What happen if I use a third party email provider to customize my emails and my plan run out of emails/month? Appwrite emails are used as fallback sending emai...
- SyntaxError: Unexpected end of JSON inpu...
I am trying to create a fcm push notification service using appwrite functions with its REST API to invoke that function from my client side app and getting thi...
- Experiencing inconsistent "500 general_u...
I am developing a task management app that uses Appwrite auth. My project is hosted on Appwrite cloud and I've created basic server-side authentication followin...