Amit Patel
Amit Patel

Reputation: 15985

Testing basic http authenticaation with digest using curl

How can we test authentication with digest as explained here using curl?

I am able to test Simple Basic example by setting Authorization header to Basic {SECRET} where SECRET is Base64::encode64("username:password") as explained here

I tried sending Authentication header with same value but getting NoMethodError (undefined method 'unpack' for nil:NilClass) on line having call authenticate_or_request_with_http_digest

Would anyone please explain what I am doing wrong here?

Upvotes: 6

Views: 10377

Answers (1)

Amit Patel
Amit Patel

Reputation: 15985

Finally I am able to fix the problem. Here is how I used curl to test http basic authentication with digest

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

Upvotes: 18

Related Questions