How to access HP ALM using REST and local javascript?

半世苍凉 提交于 2019-12-11 10:04:43

问题


I just want to access ALM via local written javascript js in the browser (IE11, Firefox) via the REST API but I can not login. Here is my code for requesting the LWSSO cookie via jquery:

var auth = btoa(USER+":"+PASSWORD);

$.ajax({
    type: "POST",
    url: https://alm.xxx.net/qcbin/authentication-point/j_spring_security_check,
    headers: {
        "Authorization": "Basic " + auth
    },
    success : function(data) { },
});

The response header contains:

https://alm.xxx.net/qcbin/authentication-point/login.jsp;jsessionid=1gfsdk4pn525f1ur55e2x2zzte?login_error

With OTA/directX object everything works fine but I want to use the REST API via javascript. Can anyone help me?


回答1:


First of all; which version of ALM are you using? Second, I think you are using the wrong URL for the authentication point. According to the documentation (for ALM 12.01) it should be https://alm.xxx.net/qcbin/authentication-point/authenticate.

Also, the HTTP method you use should be GET, not POST.

I noticed that you are using https in the URL, so I assume your instance of ALM is set up with that?



来源:https://stackoverflow.com/questions/31670129/how-to-access-hp-alm-using-rest-and-local-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!