简体   繁体   English

Apache的Worklight HTTP适配器身份验证问题

[英]worklight http adapter authentication issue with apache

I'm working on a mobile prof-of-concept using IBM's Worklight (6.1) to retrieve info via HTTP server (Apache) running on a mainframe (z/OS). 我正在使用IBM Worklight(6.1)通过大型机(z / OS)上运行的HTTP服务器(Apache)检索信息来研究移动概念验证。 I'm using the HTTP adapter procedure to log-on and retrieve data but I so far no success logging on via Worklight HTTP adapter. 我正在使用HTTP适配器过程登录和检索数据,但到目前为止,通过Worklight HTTP适配器登录都没有成功。 If I open a browser and provide the 'user:password' headers, the log-in is successful but if I try it via Worklight procedure, the '401 authorization required' error is returned. 如果打开浏览器并提供“ user:password”标头,则登录成功,但如果通过Worklight过程尝试登录,则将返回“ 401需要授权”错误。 The HTTP server error log shows: HTTP服务器错误日志显示:

.. (139)EDC5139I Operation not permitted. ..(139)EDC5139I不允许操作。 (errno2=0x0BE800DB): SAF authentication failure for "/cgi-bin/itil_v11_main.sh": SAFRunAs failure on switching SAF UID from Authorization header using %%CLIENT%% .. user (\\xe1\\xcb: authentication failure for "/cgi-bin/itil_v11_main.sh": Password Mismatch (errno2 = 0x0BE800DB):“ /cgi-bin/itil_v11_main.sh”的SAF身份验证失败:使用%% CLIENT %% .. user从授权标头切换SAF UID时SAFRunAs失败(\\ xe1 \\ xcb:“ / cgi-bin / itil_v11_main.sh“:密码不匹配

That 'password mismatch' may suggest the 'headers' are not correct? “密码不匹配”可能表明“标题”不正确? Here's the procedure: 步骤如下:

var user_id = 'userid';
var user_psw = 'userpassword';
var loginstring ;
var base64= new com.worklight.customcode.Base64Encoding();

function getITIL() {

    loginstring = base64.encode(user_id+':'+user_psw);  

    var path = '/cgi-bin/itil_v11_main.sh';

    var input = {
        method : 'get',
        headers : {         
            'Authorization' : 'Basic ' + loginstring    
        },
        returnedContentType : 'html',
        path : path
    };

    return WL.Server.invokeHttp(input);
}

It seems like you've implemented it correctly, however the complaint is on the password, which in your case originates from var base64= new com.worklight.customcode.Base64Encoding(); 看来您已正确实施,但投诉来自密码,在您的情况下,密码来自var base64= new com.worklight.customcode.Base64Encoding(); .

Because you do not supply the code that you are using in said class, it's difficult to say what the error is, but that is where you should look at for the cause of your error. 因为您没有提供在上述类中使用的代码,所以很难说出错误是什么,但这是您应在其中查找错误原因的地方。

You'll need to provide the class's implementation in order to further debug the question. 您需要提供该类的实现,以便进一步调试问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM