• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to send user credentials to a protected restful webservice

 
saipraneeth nallapareddy
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello ranchers,

i am trying to get the data from a restful webservice which is running using a java client program. I am able to connect to it and get the data, but the limitation in my code is that it can't connect to the restful endpoint which needs authentication. I h've tried search for this over online but couldn't get a proper clue. Can any one help me out.

The intention is to pass the username and password to the rest url where the authentication is required.

the two types of approaches i h've made is
 
H Paul
Ranch Hand
Posts: 471
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If this help http://hc.apache.org/httpcomponents-client-ga/tutorial/html/authentication.html
Ask the restful web service provider for the type/kind of authentication needed.
 
T.A. Nguyen
Ranch Hand
Posts: 36
Eclipse IDE Java ME Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Saipraneeth,

You can use this tiny program I created here: http://ta.cnci.org/more-about-java/29-java-servers-and-services/232-remoteservice-a-simple-client-to-test-your-restful-and-soap-services
if you are accessing a BASIC authentication type. Different authentication will required different headers setting.

Good luck,
T.A.
 
Roger Sterling
Ranch Hand
Posts: 426
Eclipse IDE Fedora Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the authentication type is OATH 1, this site will walk you through the needed header construction steps :

http://hueniverse.com/2008/10/beginners-guide-to-oauth-part-iv-signing-requests/

This article explains how to use some of the Java routines within an ESB :

http://www.soabus.org/viewtopic.php?f=3&t=13
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic