This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
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.
Juergen Meier
Greenhorn

Joined: Feb 20, 2013
Posts: 2

It works!
Thank you very much
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Digest Authentication for a Jersey Client
 
It's not a secret anymore!