Back

401 general_unauthorized_scope: role applications v1.6.0

  • 0
  • Auth
  • Web
julian.urabl
27 Mar, 2025, 18:25

Hey folks, I'm trying to handle auth on the server side in my SvelteKit app. I was able to successfully create a session with createSession() and store the sessionId and userId as http-only cookies. I'm getting them in hooks.server.ts and try and verify the session with getSession(sessionId). However I get an error of 401, 'general_unauthorized_scope', (role: applications) missing scope (account) Any leads?

TL;DR
Developers are facing a 401 error with 'general_unauthorized_scope' related to missing scope 'account' when using getSession in SvelteKit app. They followed API key scopes for auth session.write, users.read, and users.write. The issue could be with missing 'account' scope.
julian.urabl
27 Mar, 2025, 18:28

I should mention the I've been following the docs for getSession() for NodeJS and set the API key scopes for auth session.write, users.read, users.write

https://appwrite.io/docs/references/1.6.x/server-nodejs/account#getSession

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more