Skip to content
Init is here / May 19 - 23
Back

Local function with dynamic API scope does not match thoses defined

  • 0
  • Functions
Vincent Berthoumieux
6 Nov, 2024, 10:41

I'm running a function locally with dynamic API key to create users with scopes users.read and users.write (cf image)

But when I create an user

TypeScript
    await users.create(userId: userId);
    await users.createSession(userId: userId);

I get the following error:

TypeScript
Error while creating user: AppwriteException: general_unauthorized_scope, User (role: guests) missing scope (users.write) (401)

Any idea what's wrong ?

TL;DR
Developers encountering issues with creating users with dynamic API keys and scopes. When attempting to create a user, an error appears stating unauthorized scope for user with role 'guests'. This problem occurs due to missing required scope 'users.write'. Ensure the dynamic key grants necessary permissions for user creation.
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