scalaj-http icon indicating copy to clipboard operation
scalaj-http copied to clipboard

Ability to perform digest authentication

Open DavidPerezIngeniero opened this issue 8 years ago • 5 comments

Many tools like curl, Apache HttpComponents allow to do this. I think only Basic auth is possible.

DavidPerezIngeniero avatar Feb 27 '17 09:02 DavidPerezIngeniero

Yes, currently on basic auth is supported. I'll take a stab at adding digest support.

hoffrocket avatar Mar 04 '17 18:03 hoffrocket

Hi, i just added this support in c060f856ea20018040e954e303c8d7c76209d3b4, but haven't tested in the real world. Can you clone the repo and test for your use case? You can start a scala console with ./sbt console Example usage looks like: scalaj.http.Http(url).digestAuth(user, pass).asString

hoffrocket avatar Mar 04 '17 22:03 hoffrocket

Thanks.

I've evaluated this expression with the right user/password combination and it returns Unauthorized:

import scalaj.http._
Http("http://escucha03.fccma.com:8001/menu").digestAuth("user", "password").asString.body

Am I missing something?

DavidPerezIngeniero avatar Mar 06 '17 07:03 DavidPerezIngeniero

I Just pushed a potential fix. Could you pull the latest commits and try again?

hoffrocket avatar Mar 06 '17 13:03 hoffrocket

I just tried this out and it works perfectly for me.

spydon avatar Mar 10 '20 10:03 spydon