-
Notifications
You must be signed in to change notification settings - Fork 4.4k
🐛 Bug Report: Unable to create user using the server api key with users:write and users:read scope #3534
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
Comments
Based on the error, you may not be authenticated. Can you share your code (redacting values as needed)? |
api.ts
authentication.ts
Response from my node server
|
Are you using https for your endpoint? If not, would you please try with https? |
@stnguyen90
The server is running on my local machine as a docker container. Thus I'm
connecting to it using ngrok which generates a https endpoint that maps to
the local server.
…On Mon, Jul 11, 2022, 4:13 PM Steven ***@***.***> wrote:
Are you using https for your endpoint? If not, would you please try with
https?
—
Reply to this email directly, view it on GitHub
<#3534 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADNOTIZGU73C5OY2HY4PUW3VTQMXBANCNFSM53FYHDTQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Why do you need to use ngrok? Using ngrok might be causing some problems with headers. |
@stnguyen90 because I'm making api calls from a mobile app to the local server hosted on my machine |
Can you try using the LAN IP of your host machine and HTTPS instead of ngrok? |
@stnguyen90
but an error was returned
So I tried to create an appwrite droplet on digital ocean and try again using the droplet IP address. but it failed with the error
Does this mean I cannot create a user using the web client package without my own custom domain? |
What token do you need? Why do you have a node app between your front end and Appwrite?
The appwrite package is really meant for the front end, which is why there's no way to allow self signed certificates. If you really need to create an account session in a node app, I suggest manually making the API call so that you can grab the session cookie from the http response. Appwrite should generate an SSL certificate for your domain so you don't have to allow self signed certificates. |
@stnguyen90 the node app serves as the API server. so the app interacts directly with the api server and not appwrite since I might need to fetch data from different sources. I will try to manually make the api call. |
We typically put this logic in an Appwrite Function. Would that work for you and save from creating another server? |
@Edijae, do you need any more assistance or can this issue be closed? |
Closing due to inactivity |
👟 Reproduction steps
When i try to create user using my server api key with users:read and users:write scope, the request return success form the node-appwrite server library but in reality the user is never created and an exception is thrown from the docker appwrite console.
[Error] Method: POST
[Error] URL: /v1/users
[Error] Type: Utopia\Database\Exception\Authorization
[Error] Message: Missing "write" permission for role "user:62cb5ddxxx". Only this scopes "["role:all"]" are given and only this are allowed "["user:62cb5ddxxx"]".
[Error] File: /usr/src/code/vendor/utopia-php/database/src/Database/Database.php
[Error] Line: 810
👍 Expected behavior
user should be created successfully using the server api key with users:write scope
👎 Actual Behavior
No user is created
🎲 Appwrite version
Version 0.13.x
💻 Operating system
MacOS
🧱 Your Environment
No response
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: