Rank 1: Thread
Hi!
This is probably an edge case for Appwrite but is it possible to use the Web SDK getSession without cookie functionality?
The application is currently a NodeJS Console App, using the Server SDK is not feasible as accounts are created externally and API Keys is not an option.
Creating a Session via the email session function works just fine (it obviously doesn't save a cookie)
let credentails = process.env.LOGIN_CREDENTIALS.split(":"); console.log(color.yellow("** Authenticating with master server using provided credentials **")); session = await account.createEmailSession( credentails[0], credentails[1] );
console.log(color.yellow(`** Logged in as ${session.providerUid}`));Now onto the part I am getting stuck on:
I noticed there is an getSession(sessionId: string) function
in the Account class, unfortunately it crashes Appwrite as it cannot read the cookie for obvious reasons.
appwriteexception: User (role: guests) missing scope (account) at Client.<anonymous> (/workspace/**/node_modules/appwrite/dist/cjs/sdk.js:393:27) at Generator.next (<anonymous>) at fulfilled (/workspace/**/node_modules/appwrite/dist/cjs/sdk.js:24:58) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { code: 401, type: 'general_unauthorized_scope', response: { message: 'User (role: guests) missing scope (account)', code: 401, type: 'general_unauthorized_scope', version: '1.3.1' }}My question is: Is it possible to:
1st, verify a session by session id without a cookie
2nd, get user details by session id without a cookie
I know that using the Web SDK is not the proper way, but I haven't found a way to authenticate without exposing an api key to users, as it is a public image.