Skip to content
Back

Create user via REST error - User (role: guests) missing scope (account)

  • 0
  • Auth
  • Cloud
  • REST API
lorenalexm
30 Nov, 2024, 23:24

I am creating a Blazor WASM client to work with Appwrite Cloud, and since to my knowledge there is no Blazor SDK I have been working with wrapping the REST API as I need. I have the login and logout system working with a dummy account created in the Appwrite Dashboard. Though when attempting to create a new user within the Blazor app I keep receiving the following 401 message back.

TypeScript
{
"message": "User (role: guests) missing scope (account)",
"code": 401,
"type": "general\_unauthorized\_scope",
"version": "1.6.0"
}

I have verified that all previous sessions have been cleared, even checking cookies and local storage, before attempting to create a new user. The issue still clings on though. The C# code is rather simple, and can be seen below. Is there something else I am missing in trying to get user creation to function properly? Thank you in advance for any insight!

Code: https://pastebin.com/dnB5CHZ8

TL;DR
Issue: When attempting to create a new user in Blazor WASM client using Appwrite Cloud REST API, receiving a 401 error message stating "User (role: guests) missing scope (account)." Solution: The error is due to missing account scope for the guests role. To resolve this, ensure that the appropriate scope is set for the guests role in the Appwrite Cloud dashboard. Once the scope is correctly configured, reattempt 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