0
votes

My ArangoDB server contains a database (mydb) with a collection (thiscol) and in the collection sits a bit of data. I can login with a user Thijs and look around using the web interface.

I cannot have user Thijs use the REST API, I have tried setting the password, granting access, restarting and making a new user.

The REST interface always returns 401 Unauthorized. I have obviously quadrupple checked the password.

If I use the user root it all works fine. And I rather not start with Foxx services at this point because it seems to be an enormous amount of work to implement a REST service that allready exists but is not 'available'.

So is the REST API only implemented for a single hard-coded username or am I missing something here..

REST call example: http://localhost:8529/_api/collection

per request enter image description here

failing GET enter image description here

1
When you use the ArangoDB web UI, and you go to the _system database, have you added access for your user via the 'USERS' section of the web site? It is important that you add access for your user to the mydb collection.David Thomas
I have added access on the database level, read and write. I did find this in the log: Starting up with role SINGLEThijs
So just to be sure, when you go to USERS and then click on your user, then click on the Permissions tab, you see Read & Write (rw) checked on your mydb collection? If you do, you should be able to login to the ArangoDB web UI via the console, just make sure you select mydb when you chose a database after providing your username and password. Now when you authenticate via REST, how do you provide your username and password?David Thomas
Added a sreenshot to prove it. The db is called vbo in this case. This user thijs can log in, query and truncate the test collection is db vbo. I will add a screenshot for the REST call. I use BASIC auth. It works for root.Thijs
Ah, you need to specify the database to use in the URL, without specifying a database it will default to _system. Try localhost:8529/_db/vbo/_api/collection see this documentation page for more info.David Thomas

1 Answers

1
votes

Ah, you need to specify the database to use in the URL, without specifying a database it will default to _system. Try localhost:8529/_db/vbo/_api/collection see this documentation page for more info.

Glad to help get it resolved.