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
- Issue with OAuth 2.0 authentication
Good evening, I’m reaching out because I’m having a small issue with Appwrite. I’m trying to set up OAuth2 with Twitch, and even though I’m entering the correc...
- Domain Help
My domain estimately.me is verified in Appwrite DNS but SSL certificate keeps failing with: DNS problem: server failure at resolver looking up A for estimately....
- What's the proper way to delete user acc...
I would like to provide an option for the users of my app, to completely remove theirs account if they want to. I don't want to 'deactivate' the account, but to...