Hi Francois!
I figured I'd send you a response to this topic as I've been dealing with MQ and LDAP for the better part of almost 2 years now. Now my approach isn't the easiest and would require some help from your AD admins to get groups and such sorted but here's what worked for us.
1. We had the AD admins create two new groups under the same part of the AD tree so that it was easier for MQ (MQ isn't smart enough to search outside of a nested tree). Something like MQ_Admin and MQ_Dev would work or whatever naming convention you use where you work.
Obviously you would put the admins in the MQ_Admin group and the Devs or whoever would have "read-only" access into the MQ_Dev group.
2. You then need to make sure MQ is at the correct fix pack level, which if I remember it needs a minimum of MQ 8.0.0.2 and that you set the command level to 802. The command level doens't have anything to do with the actual version of MQ from what I remember as a side note. To do that, you'll need to stop the qmgr and then issue the command:
strmqm -e CMDLEVEL=802
Then you can start it normally and verify with echo "dis qmgr all" | runmqsc
3. You need to create an authinfo object to connect to your ldap server and somethings will be different in your setup based upon IP addresses and group names and such but I'll show you mine just so you can see what settings are enabled.
DEFINE AUTHINFO('USE.LDAPG') AUTHTYPE(IDPWLDAP) AUTHORMD(SEARCHGRP) CHCKCLNT(OPTIONAL) CHCKLOCL(OPTIONAL) CONNAME('1.2.3.4(389') LDAPUSER('CN=iibadmin,OU=it,OU=corp,OU=Members,DC=test,DC=com') LDAPPWD('XXXXXX') SECCOMM(NO) USRFIELD('CN') BASEDNU('OU=data,OU=Groups,DC=test,DC=com') CLASSUSR('user') ADOPTCTX(YES) SHORTUSR('sAMAccountName') FINDGRP('memberOf') GRPFIELD('CN') BASEDNG('OU=data,OU=Groups,DC=test,DC=com') CLASSGRP('group') NESTGRP(YES) FAILDLAY(60) replace
This will allow you to set all of your MQ authorizations for the groups you had created in LDAP with your setmqaut commands (I scripted it and can post that too).
4.refresh security type(connauth)
4a. You can issue
echo " dis qmstatus all" | runmqsc <qmgr>
to see if the LDAP connections says "CONNECTED" or "ERROR" if it's error you'll need to check the AMQ Logs.
5. Tell the qmgr to use the newly created connauth with alter qmgr connauth('USE.LDAPG')
6. Refresh security connauth again as in step 4.
7. This one is optional / I was told to do it by IBM but I don't believe you need to. Add the following to the qm.ini:
Security:
GroupModel=GlobalGroups
8. We then created channels specific for those groups so that we can later secure them with chlauths. We created an admin only server conn channel and a dev utils server conn channel. Each will get different perms.
9. Here's my admin script for the admin channel:
#!/bin/bash
### ADMIN FOR MQ ###
if [ $# -ne 1 ]
then
echo -e "\nUsage: QMGRNAME\n"
echo -e "Example: $0 MBUFTW01 \n"
exit 1
fi
echo "def channel(LTADMIN.SVRCONN) chltype(svrconn) trptype(tcp) replace" | runmqsc $1
setmqaut -m $1 -g iib_Admin -t qmgr +all +alladm +allmqi +crt
setmqaut -m $1 -g iib_Admin -n '**' -t queue +all +alladm +allmqi
setmqaut -m $1 -g iib_Admin -n 'SYSTEM.ADMIN.COMMAND.QUEUE' -t queue +all +alladm +allmqi
setmqaut -m $1 -g iib_Admin -n 'SYSTEM.MQEXPLORER.REPLY.MODEL' -t queue +all +alladm +allmqi
setmqaut -m $1 -g iib_Admin -n 'SYSTEM.DEFAULT.MODEL.QUEUE' -t queue +all +alladm +allmqi
echo "set chlauth(LTADMIN.SVRCONN) type(addressmap) address(*) mcauser('iib_Admin') action(replace)" | runmqsc $1
echo "set chlauth(LTADMIN.SVRCONN) type(addressmap) address(*) usersrc(channel)" | runmqsc $1
echo "set chlauth(LTADMIN.SVRCONN) type(blockuser) userlist('nobody')" | runmqsc $1
setmqaut -m $1 -g iib_Admin -n '**' -t namelist +all +alladm +allmqi
setmqaut -m $1 -g iib_Admin -n '**' -t process +all +alladm +allmqi
setmqaut -m $1 -g iib_Admin -n '**' -t authinfo +all +alladm +allmqi
setmqaut -m $1 -g iib_Admin -n '**' -t channel +all +alladm +allmqi
setmqaut -m $1 -g iib_Admin -n '**' -t service +all +alladm +allmqi
setmqaut -m $1 -g iib_Admin -n '**' -t listener +all +alladm +allmqi
setmqaut -m $1 -g iib_Admin -n '**' -t clntconn +all +alladm +allmqi
setmqaut -m $1 -g iib_Admin -n '**' -t topic +all +alladm +allmqi
# Default allow-all browse,inq and dsp to all queues
setmqaut -m $1 -g iib_Admin -n '**' -t queue +all +alladm +allmqi
# Allow limited access to command queue.
setmqaut -m $1 -g iib_Admin -n 'SYSTEM.ADMIN.COMMAND.QUEUE' -t queue +all +alladm +allmqi
# Allow access to SYSTEM.MQEXPLORER.REPLY.MODEL if it exists.
setmqaut -m $1 -g iib_Admin -n 'SYSTEM.MQEXPLORER.REPLY.MODEL' -t queue +all +alladm +allmqi
# Allow access to SYSTEM.DEFAULT.MODEL.QUEUE.
setmqaut -m $1 -g iib_Admin -n 'SYSTEM.DEFAULT.MODEL.QUEUE' -t queue +all +alladm +allmqi
echo "refresh security(*)" | runmqsc $1
And here's our read only script:
### READ ONLY FOR MQ ###
if [ $# -ne 1 ]
then
echo -e "\nUsage: QMGRNAME\n"
echo -e "Example: $0 MBUFTW01 \n"
exit 1
fi
echo "refresh security type(connauth)" | runmqsc $1
echo "def channel(DEVUTILS.SVRCONN) chltype(svrconn) trptype(tcp) replace" | runmqsc $1
setmqaut -m $1 -g iib_Users -t qmgr +connect +inq +dsp
setmqaut -m $1 -g iib_Users -n '**' -t queue +all
setmqaut -m $1 -g iib_Users -n 'SYSTEM.ADMIN.COMMAND.QUEUE' -t queue +all
setmqaut -m $1 -g iib_Users -n 'SYSTEM.MQEXPLORER.REPLY.MODEL' -t queue +all
setmqaut -m $1 -g iib_Users -n 'SYSTEM.DEFAULT.MODEL.QUEUE' -t queue +all
echo "set chlauth(DEVUTILS.SVRCONN) type(addressmap) address(*) mcauser('iib_Users') action(replace)" | runmqsc $1
echo "set chlauth(DEVUTILS.SVRCONN) type(addressmap) address(*) usersrc(channel) action(replace)" | runmqsc $1
echo "set chlauth(DEVUTILS.SVRCONN) type(blockuser) userlist('nobody') action(replace)" | runmqsc $1
setmqaut -m $1 -g iib_Users -n '**' -t namelist -all +dsp +inq
setmqaut -m $1 -g iib_Users -n '**' -t process -all +dsp +inq
setmqaut -m $1 -g iib_Users -n '**' -t authinfo -all +dsp +inq
setmqaut -m $1 -g iib_Users -n '**' -t channel -all +dsp
setmqaut -m $1 -g iib_Users -n '**' -t service -all +dsp
setmqaut -m $1 -g iib_Users -n '**' -t listener -all +dsp
setmqaut -m $1 -g iib_Users -n '**' -t clntconn -all +dsp
setmqaut -m $1 -g iib_Users -n '**' -t topic -all +dsp +sub
# Default allow-all browse,inq and dsp to all queues
setmqaut -m $1 -g iib_Users -n '**' -t queue -all +browse +inq +dsp
setmqaut -m $1 -g iib_Users -n '**' -t queue +put +get
# Allow limited access to command queue.
setmqaut -m $1 -g iib_Users -n 'SYSTEM.ADMIN.COMMAND.QUEUE' -t queue -all +inq +put +dsp
# Allow access to SYSTEM.MQEXPLORER.REPLY.MODEL if it exists.
setmqaut -m $1 -g iib_Users -n 'SYSTEM.MQEXPLORER.REPLY.MODEL' -t queue -all +inq +put +get +dsp +clr
# Allow access to SYSTEM.DEFAULT.MODEL.QUEUE.
setmqaut -m $1 -g iib_Users -n 'SYSTEM.DEFAULT.MODEL.QUEUE' -t queue -all +inq +put +get +dsp +clr
echo "refresh security type(connauth)" | runmqsc $1
echo "refresh security(*)" | runmqsc $1
Now here's where it gets a little weird. You have to switch the authinfo back for user search. Because the authinfo above in step 3 is for group search in order to put the auths on the groups (so you don't have to run them for each user), you can't do a user look up...so to get around that, you can define the same authinfo object with the replace option at the end with the following:
DEFINE AUTHINFO('USE.LDAPG') AUTHTYPE(IDPWLDAP) AUTHORMD(SEARCHUSR) CHCKCLNT(OPTIONAL) CHCKLOCL(OPTIONAL) CONNAME('1.2.3.4(389)') LDAPUSER('CN=iibadmin,OU=it,OU=corp,OU=Members,DC=test,DC=com') LDAPPWD('XXXXXX) SECCOMM(NO) USRFIELD('') BASEDNU('OU=Members,DC=test,DC=com') CLASSUSR('user') ADOPTCTX(YES) SHORTUSR('sAMAccountName') FINDGRP('memberOf') GRPFIELD('OU=data,OU=Groups,DC=test,DC=com') BASEDNG('OU=data,OU=Groups,DC=test,DC=com') CLASSGRP('group') NESTGRP(YES) FAILDLAY(60) replace
The main difference is the AUTHORMD changes from SEARCHGRP in step 3 to SEARCHUSR and what that does is lets MQ authenticate LDAP users now instead of the groups. The beauty is all the users coming in have to be in one of the two groups that you define above on those channels.
After that refresh security type connauth again
Then we defined channel auths for those two channels:
set chlauth(DEVUTILS.SVRCONN) type(addressmap) address(*) mcauser('iib_USers') action(replace)
set chlauth(LTADMIN.SVRCONN) type(addressmap) address(*) mcauser('iib_Admin') action(replace)
refresh security once more / recycle the qmgr and now all users coming in should be required to be in ldap and all tools such as RFHUTIL, MQ Explorer, etc will require user ID / password (their windows creds). You can add ssl and certs on top of everything as well.
We added some other chlauths and security measures in as well but this is the base of how we got things connecting and working.
Sorry for the long post! If you have any questions feel free to to contact me at nmurn@leveragingtechnology.com as I don't check these boards very often (A co-worker forwarded me your post). Good luck!