Testing basic http authentication with curl digest

How can we test authentication using a digest as described here using curl?

I can test Simple Basic by setting the Authorization header to Basic {SECRET} , where SECRET is Base64::encode64("username:password") , as described here

I tried to send an Authentication header with the same value, but getting NoMethodError (undefined method 'unpack' for nil:NilClass) on a line calling authenticate_or_request_with_http_digest

Can someone explain what I'm doing wrong here?

+6
source share
1 answer

Finally, I can fix this problem. This is how I used curl to verify HTTP authentication using digest

 curl --data {"red":"00"} --digest -u "username:password" "http://localhost:3000/api/statistics" 
+18
source

Source: https://habr.com/ru/post/925014/


All Articles