Rank 2: Process
Hi, is there any way to get users session token from server by JWT?
Votes
1
Replies
18
Participants
Unknown
Messages
19
Rank 2: Process
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?
Rank 2: Process
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 🧐
Rank 2: Process
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
This way the cookie will be in your server and client.
Here's an example of this setup: https://svelte-kit.ssr.almostapps.eu/
Rank 2: Process
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.
Rank 2: Process
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
Rank 2: Process
Wow, ok, thank you very much... going to try it
Rank 2: Process
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
Rank 2: Process
this is my code
Rank 2: Process
I hope i understand but in url is only http://localhost:5222/oauth2/success nothing else
You're missing auth
Rank 2: Process
I am very sorry, i thought that it was only an example. Yes now i can see it. Thank youu soooo much.
Rank 2: Process
Please is for email session something similar?
No
[SOLVED] The way to get users session token