Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Digest Authentication for a Jersey Client

 
Juergen Meier
Greenhorn
Posts: 2
Eclipse IDE MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
Eclipse IDE MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It works!
Thank you very much
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic