Hi, is there any way to get users session token from server by JWT?
It sounds like you're asking for something like impersonation. That's not available yet. The user would have to pass something to the server.
Can you give some additional context on your use case?
yes user would give JWT token to server and server would get session token from appwrite
The JWT token is already the session ...so server wouldn't have to get any other token π§
yes, but i would like to get session token because i want to store it into cookies on client-side.........for later access........... i am using sveltekit SSR and i can use only cookies for authentication
The best thing to do might be to
- Set up Appwrite endpoint to be a sub domain of your app
- send the email and password to the server
- Manually log in server side
- Grab the cookie from the response header
- Set the cookie for your client side
This way the cookie will be in your server and client.
Here's an example of this setup: https://svelte-kit.ssr.almostapps.eu/
yes that is what i do. But this way i cant use OAuth2 authentication. And will not be there any problem with rate limit for creating session from server, i mean when all sessions will be created on server-side.
for example, now i cant log in because of rate limit (the error is on server-side)
For oauth2, redirect back to your server at the path /auth/oauth2/success. There should be a secret in the URL that is the cookie value.
You should be fine on rate limit because the rate limit key includes the email
Wow, ok, thank you very much... going to try it
No here (/auth/oauth2/success) is no secret in URL. For OAuth2 i am using your client lib on client is it ok or i have to use rest api?
What's your code? What's in the URL when you hit that page?
Yes, using our SDK should be fine
this is my code
I hope i understand but in url is only http://localhost:5222/oauth2/success nothing else
You're missing auth
I am very sorry, i thought that it was only an example. Yes now i can see it. Thank youu soooo much.
Please is for email session something similar?
No
[SOLVED] The way to get users session token
Recommended threads
- how to access the value of account statu...
- Redirect from clicking team invite link ...
Hi all! Pretty new to app development in general so this might be something more generic than appwrite, but I've found (after reading the docs for the Teams API...
- Hosting Issues with Static IP not domain...
I have a machine with Static Public IP. I want to host Appwrite Site on it but I tried it but it doesn't allow IP addresses in Domain names. What should I do h...