Back

desktop app - auth

  • 0
  • Auth
zrg0
3 Feb, 2025, 20:07

So i have a desktop app. First i created a user, then created a session. But it seems i also need JWT to call APIs (ie create document). CallingJTW with session id in header (X-Appwrite-Session), just returns:

Response: Object { "code": Number(401), "message": String("User (role: guests) missing scope (account)"), "type": String("general_unauthorized_scope"), "version": String("1.6.1"), }

TL;DR
Developers need to use the `X-Appwrite-JWT` header with the JWT token when calling APIs in the desktop app, not the `X-Appwrite-Session` header. Using JWT with the session ID in the header will lead to a 401 error due to insufficient permissions.
Kenny
3 Feb, 2025, 20:09

You would use the jwt with this header

X-Appwrite-JWT

https://appwrite.io/docs/apis/rest#jwt

Kenny
3 Feb, 2025, 20:09

x-appwrite-session is the header for the appwrite session token. Which is not the jwt token.

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