ibm-messaging / mq-cph

The IBM MQ C Performance Harness
Apache License 2.0
11 stars 6 forks source link

LDAP authentication fails with userPrincipalName filled with email address #5

Closed wjurmy closed 2 years ago

wjurmy commented 2 years ago

The userPrincipalName in our LDAP server is defined as an email address. mq-test-user@common.onmicrosoft.com The library is unable to pass the email address as the username to the server. Any character before the '@' sign in the username get concatinated with the password.

Command: cph [...] -us "mq-test-user@common.onmicrosoft.com" -pw "strongpassword:


Error log from the server. 
2022-02-19T13:59:17.425Z AMQ5531E: Error locating user or group in LDAP [CommentInsert1(ldap_search), CommentInsert2(mq-test-user), CommentInsert3((&(objectClass=user)(userPrincipalName=mq-test-userstrongpassword)))]

Error from the terminal:

Shared library libmqic_r.so loaded ok
[PutGet0] START
[PutGet0] Connecting to QM: AZQT01 (connection: 10.16.128.04(443); channel: TESTCHANNEL)

Created Error message to pass to runtime_error()
Call to MQCONNX failed [Completion code: 2; Reason code: 2035]
Sending errorMsg to STDERR
Call to MQCONNX failed [Completion code: 2; Reason code: 2035]
]][PutGet0] Caught exception: Call to MQCONNX failed [Completion code: 2; Reason code: 2035]
]
[PutGet0] STOP
rate=0.00,threads=0
[ControlThread] Caught exception: PutGet0: State ERROR set.
totalIterations=0,totalSeconds=1645279167.26,avgRate=0.00
controlThread STOP
terminate called after throwing an instance of 'std::exception'
 what():  std::exception
Aborted

We are using the 9.2.0.4 MQ client. OS: Lastest CentOS

pharrishur commented 2 years ago

Sorry for the delay in seeing this. I can confirm this appears to be a bug in cph. I've replicated the issue and am looking at it now.