my dog learned polymorphism*
The moose likes Web Services and the fly likes Digest Authentication for a Jersey Client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Digest Authentication for a Jersey Client" Watch "Digest Authentication for a Jersey Client" New topic
Author

Digest Authentication for a Jersey Client

Juergen Meier
Greenhorn

Joined: Feb 20, 2013
Posts: 2

Hi,
I am trying to make a Java-client to access a restful webservice, running on a tomcat. I always get a 401 error, and I have to authenticate with digest authentication.
How can I do that?

Are there any libraries or Frameworks that can do that?

Do you have any recomendations or source code examples for that task?

Thanks a lot,
Dohar
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41613
    
  55
What kind of client are you using? If it's the Jersey client, something like "cli.addFilter(new HTTPDigestAuthFilter(username, password));" should work.

Apache HttpClient or HttpComponents also support DIGEST.


Ping & DNS - my free Android networking tools app
Juergen Meier
Greenhorn

Joined: Feb 20, 2013
Posts: 2

It works!
Thank you very much
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Digest Authentication for a Jersey Client