Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug Report: Admin can't create account #7507

Closed
2 tasks done
step135 opened this issue Jan 28, 2024 · 2 comments
Closed
2 tasks done

🐛 Bug Report: Admin can't create account #7507

step135 opened this issue Jan 28, 2024 · 2 comments
Labels
bug Something isn't working product / auth Fixes and upgrades for the Appwrite Auth / Users / Teams services.

Comments

@step135
Copy link

step135 commented Jan 28, 2024

👟 Reproduction steps

POST https://cloud.appwrite.io/v1/account
Content-Type: application/json
X-Appwrite-Project: <project_id>,
X-Appwrite-Key: <api_key>,
Content-Type: application/json,
{ email: "[email protected]", password: "123456789", userId: "randomId" }

Responose:

{
    "message": "app.<appId>@service.cloud.appwrite.io (role: applications) missing scope (public)",
    "code": 401,
    "type": "general_unauthorized_scope",
    "version": "0.12.49"
}

And what's weird, when I don't send X-Appwrite headers:

{
    "message": "Param \"userId\" is not optional.",
    "code": 400,
    "type": "general_argument_invalid",
    "version": "0.12.49"
}

👍 Expected behavior

I am sending userId so the error message should be different in case without headers. Admin api_key should have all possible security scopes allowed.

👎 Actual Behavior

It doesn't create new account and the error message is weird.

🎲 Appwrite version

Appwrite Cloud

💻 Operating system

Something else

🧱 Your Environment

No response

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@step135 step135 added the bug Something isn't working label Jan 28, 2024
@docimin
Copy link

docimin commented Jan 31, 2024

Hey.

You shouldn't create an account using an API key.
As it says here: missing scope (public), you just need to make an API request without any JWT or API Key.

@eldadfux
Copy link
Member

Or for creating a user account from your server side with an API key you can use the Users service with a proper scope

@eldadfux eldadfux added the product / auth Fixes and upgrades for the Appwrite Auth / Users / Teams services. label Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working product / auth Fixes and upgrades for the Appwrite Auth / Users / Teams services.
Projects
None yet
Development

No branches or pull requests

3 participants