I've seen examples of how to authenticate with a database using arangosh, but I couldn't find anything in the documentation about how to authenticate via the http API. Is this possible? Is it something like this:
相关问题
- Angular RxJS mergeMap types
- java client program to send digest authentication
- Google Apps Script: testing doPost() with cURL
- How to instantiate Http service in main.ts manuall
- C#使用http访问网络,有办法用指定网卡访问网络嘛?
相关文章
- C#使用http访问网络,有办法用指定网卡访问网络嘛?
- Is a unicode user agent legal inside an HTTP heade
- git: retry if http request failed
- Flutter - http.get fails on macos build target: Co
- User.Identity.IsAuthenticated vs WebSecurity.IsAut
- C# HttpClient.SendAsync always returns 404 but URL
- SwiftUI - Vertical Centering Content inside Scroll
- Override UserManager in django
Ok, after playing around with authentication in Arango DB on Windows here is what I have found:
I could not get this command to work (which is supposed to enable authentication)
UPDATE: I realized I couldn't get this command working because it's not a command at all :-o After looking more closely at the documentation it's a command line option. It should be used when you start arangosh. See documentation here.
I assume I need to adapt it somehow to work in a windows command prompt, but I'm not sure what needs to change. As a work around I opened the file "arangod.conf" (I found it here C:\Program Files (x86)\ArangoDB 1.4.7\etc\arangodb) and changed the following line:
to
This enabled authentication when I restarted Arango. Yay!
Now to authenticate via http... very simple. It's just basic HTTP auth. So in my case I was using NodeJS and the request library to authenticate. Both examples below work fine.
Credentials appended with .auth:
OR with credentials in url:
It's done through
Authorization
header where you set authentication mechanism (e.g. Basic) followed by base64 encoded string in format[username]:[password]
. More information can be found for example here.From the command line, you can do something like this to pass HTTP basic authentication to the server:
The above example is for curl. If you use any other HTTP client, you have to find the options for setting the username / password for HTTP basic authentication and send them to the server.