从Worklight适配器调用受密码保护的URL时如何输入用户凭据?

时间:2014-03-14 14:23:51

标签: rest ibm-mobilefirst worklight-adapters worklight-security

我想通过http适配器调用休息服务。我对其余服务的URL请求获取请求,但它位于受密码保护的域中。 (如果我尝试从浏览器访问该URL,则会弹出一个用户名和密码的窗口。)如何将这些凭据与我的get请求一起传递?我必须在那之前提出要求吗?

1 个答案:

答案 0 :(得分:3)

使用HTTP适配器的元素。

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

访问服务网址时会传递网络凭据。