Back

(role: applications) missing scope (account) Please Help

  • 0
  • Web
Vodi
19 Dec, 2024, 17:26

I'm using an api key with all the permissions to create a client. This client is then being used to get the 'current' session:

const client = new Client() .setEndpoint(process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT!) .setProject(process.env.NEXT_PUBLIC_APPWRITE_PROJECT!) .setKey(process.env.NEXT_APPWRITE_SECRET!);

const account = new Account(client);

const session = await account.getSession('current'); This returns an error:

response: {

message: 'app.___.cloud.appwrite.io (role: applications) missing scope (account)',

code: 401,

type: 'general_unauthorized_scope',

version: '1.6.1'

}

Before this is executed, I'm creating a session when logging in the user and in this code, im executing it when attempting to logout the user. I'm 100% sure im using the correct API key so i have no idea why its saying its unauthorised. someone please help

TL;DR
Developers are running into an authorization error with their Appwrite API key when trying to create a client and retrieve a session. The error message indicates a missing scope related to the account. Double-check the permissions assigned to the API key and ensure it has the necessary scopes.
Vodi
19 Dec, 2024, 17:26

(role: applications) missing scope (account) Please Help

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