2

I want to call a rest service via http adapter. I do a get request to the url of the rest service but it is in a password protected domain. (if i try to access the url from browser it pops up a window for username and password.) How can i pass these credentials along with my get request? do i have to make a post request before that?

mike_x_
  • 1,900
  • 3
  • 35
  • 69
  • Maybe this will provide some insight: http://stackoverflow.com/questions/17700910/attaching-cookie-to-worklight-adapter-response-header – Idan Adar Mar 14 '14 at 14:58
  • The two answers in this question might also shed some light: http://stackoverflow.com/questions/16921978/authorizing-http-adapter-in-ibm-worklight – eabe Mar 15 '14 at 18:36

1 Answers1

3

Use the element of the HTTP adapter.

<authentication>
  <basic/>
    <serverIdentity>
      <username> ${user} </username>
      <password> ${password} </password>
   </serverIdentity>
</authentication>  

It will pass the network credential while accessing the service url.

Ragu
  • 402
  • 1
  • 4
  • 18