ibm-messaging / mq-mqi-nodejs

Calling IBM MQ from Node.js - a JavaScript MQI wrapper
Apache License 2.0
79 stars 42 forks source link

Got error code 2035 #135

Closed zkxil closed 2 years ago

zkxil commented 2 years ago

Hi here is my code.

var cd = new mq.MQCD();
cd.ConnectionName = "xxxxx.ahe.boulder.ibm.com(1414)";
cd.ChannelName = "xxxxxx";
// Make the MQCNO refer to the MQCD
cno.ClientConn = cd;
var qMgr = "xxx";
var qName = "TEST";
// To add authentication, enable this block
if (true) {
    var csp = new mq.MQCSP();
    csp.UserId = "mquser";
    csp.Password = "";
    cno.SecurityParms = csp;
}

mq.ConnxPromise(qMgr, cno)

I got error message "MQRC_NOT_AUTHORIZED [2035]". Then I contact with the MQ server support, support said I need to set the userid and leave the password empty, I send MQ message by Java code successfully, but for NodeJS still failed.

Can you give me some advice?

ibmmqmet commented 2 years ago

The only time it would be valid to use a userid with a blank password is if your account on the remote system really is configured that way or the qmgr's AUTHINFO object has CHCKLOCL/CHCKCLNT attribute set to "none" to ignore the passed parameters. I suspect you've been given bad advice by your server support person. The qmgr's error logs will give a lot more information about the auth failure

zkxil commented 2 years ago

Thanks for reply. It's weird. Using userid with a blank password, I can connect to MQ server by IBM MQ explorer and Java code successfully. Any attribute I need to fill for mq.MQCSP()? or other things I need to do?

ibmmqmet commented 2 years ago

Java programs (particularly before version 9.2.3) behave differently in how they pass userids by default. All I can tell you is to read my previous comment, and look at your qmgr configuration and error logs.

zkxil commented 2 years ago

Sorry for rely late, I've asked support team to check the attribute.