webdis
webdis copied to clipboard
Q: Basic_authentication cannot use with http://user:[email protected]:7379/command
Hello I tried to configured acl in webis.json as follows: "acl": [ { "disabled": ["*"] },
{
"http_basic_auth": "user:password",
"enabled": ["SET"]
}
]
I can use curl -u user:password to execute "SET" command. Unfortunately, ACL does not work when I input URL to chrome browser: http://user:[email protected]/set/key/1 , I always get 403 forbidden.
Any suggestion for this? Please note that I am using the the released version 0.1
Thanks,
Hello any answer for this?
I am seeing the same issue. I don't think wedbis is asking the browser to authenticate the user. curl sends the token with the request -- the browser sends the request and webdis simply says 403.
Hello,
Using Chrome with the inspector, I can't see any Basic Auth data being sent:
Am I missing something? How should this be sent?
I'm not exactly sure why this isn't working for you, but the solution is this:
var token = btoa(user+':'+pass)
var header = 'Basic: ' + token;
Add the header
variable to the XHR request under the Authorization
header.
If you're just trying to test your implementation, try using Postman. It will automatically add the header for you if you add a username and password to the request. Otherwise, you'll have to do the base64 encoding yourself.
Browser expects a 401, which webdis does not sent. It responds immediately with 403. Curl, on the other hand, sends "Authentication: Basic ####" headers right away.. If you want to talk to webdis from JavaScript, just make sure to send the appropriate headers right away.