#[SOLVED] Auth login in server side

38 messages · Page 1 of 1 (latest)

peak ridge
#

I want something like generate jwt in postman , and use the session or jwt something to put in header in postman. So that when I fetch data in database it only returns the data that the user owned.

woeful linden
peak ridge
#

definitely, but i dont want to use api key, since api can access all data . I want something like similar to the jwt token that recognize the user so then it will only fetch the data that the user have permission

woeful linden
# peak ridge definitely, but i dont want to use api key, since api can access all data . I ...

The Account service allows you to authenticate and manage a user account. You can use the account service to update user information, retrieve the user sessions across different devices, and fetch the user security logs with his or her recent activity.

Register new user accounts with the [Create Account](/docs/references/cloud/client-web/accoun...

peak ridge
#

that is for client side not server side

woeful linden
peak ridge
#

hmmm did you try it?

woeful linden
peak ridge
#

sorry for mentioning you @twin creek is it okay to use the client side in server side for example in postman?

woeful linden
peak ridge
woeful linden
peak ridge
#

alright then I let you know after I test this

peak ridge
woeful linden
# peak ridge but the question is how can the postman handle the user cookies?

Been a while since I used Postman (since they implemented that whole cloud sync thing), but I’ve created Appwrite sessions direct with curl, and with other, similar tools. The /account/sessions/email endpoint will return Set-Cookie headers. You can just copy these into the request (I think Postman can handle the cookies automatically, too?)

twin creek
# peak ridge sorry for mentioning you <@1087889306208718959> is it okay to use the client si...

I don't understand at all the context. JWT is generated server sided and sent client side to perform operations during 15 minutes. You can use it server sided to work as the user with the same permissions the user has rather than performing your own checks with a function for example.

If the main doubt is generating it server sided to use it server sided, then I don't understand what's the main use case for this 🤔

woeful linden
twin creek
#

Okay, I understand now

#

Basically it's possible to do the cookies approach as you said, main advantage is that they will not need to be renewed every 15 min

peak ridge
woeful linden
peak ridge
#

[SOLVED] Auth login in server side

twin creek
woeful linden
twin creek
#

Server side is harder to be manipulated

#

That's the main difference

woeful linden
twin creek
#

Yes, I mean, server side SDK is basically limitless, it doesn't have rate limits since it's supposedly in a secure/controlled environment, meanwhile client side have rate limits to prevent abuse and needs authentication to access a specific resource meanwhile server side bypasses security checks with the API key scopes

Main issue on using client server sided is that it can hit rate limits since it will probably use the same IP address to perform the requests

woeful linden
woeful linden
twin creek
#

But yes, you can

woeful linden
twin creek
#

But it will give you access to for example the entire database

woeful linden
#

But my point here was simply that yes, you can call all the REST APIs you like in Postman

woeful linden