One of the main security highlights of MQ V8 is a feature called Connection Authentication which allows applications to provide a user ID and password and have the queue manager validate it is correct before allowing the application to successfully connect. You can read more about this feature in a number of resources:-
To allow some of our samples to be used with this new feature we have also made the following updates.
The sample C program that demonstrates how to specify client connection information on MQCONNX, amqscnxc, has been updated to take an extra flag in its input parameters to allow you to specify a user ID. When the user ID is provided it then prompts you for a password when the application runs. This gives it the following usage string now:-
amqscnxc [-x ConnName [-c SvrconnChlName]] [-u User] [QMgrName]
So you can use this with client channel details like so:-
> amqscnxc -x machine1.ibm.com(1515) -c APPL.SVRCONN -u hughson QM1 Sample AMQSCNXC start Connecting to queue manager QM1 using the server connection channel APPL.SVRCONN on connection name machine1.ibm.com(1515). Enter password: passw0rd Connection established to queue manager QM1 Sample AMQSCNXC end
Or fall back to the MQSERVER environment variable or a CCDT like so:-
amqscnxc -u hughson QM1
A number of other samples were also updated which follow a slightly different pattern.
|amqsput / amqsputc||Sample C program that puts messages to a message queue|
|amqsget / amqsgetc||Sample C program that gets messages to a message queue|
|amqsbcg / amqsbcgc||Sample program to read and output the message descriptor fields, any other message properties and the message content of all the messages on a queue|
This set of samples all took their parameters as positional parameters and so adding a new parameter would mean that all the other parameters have to be provided as well. So instead these samples pay attention to an environment variable named MQSAMP_USER_ID. If this is set to something that value will be used as the user ID and futhermore the sample will prompt you to supply a password to go with it:-
set MQSAMP_USER_ID=hughson > amqsput Q1 QM1 Sample AMQSPUT0 start Enter password: passw0rd target queue is Q1 My Message text Sample AMQSPUT0 end
A couple of the JMS samples have also been updated to have a user ID as a parameter. These are JmsProducer and JmsConsumer. These have had -u and -w flags added to them so you can use them like this:-
Where mqinst is the location of your MQ installation.
java JmsProducer -m QM1 -d Q1 -u hughson -w passw0rd Enter some text to be sent in a message <ENTER to finish>:My Message Text Sent message: JMSMessage class: jms_text JMSType: null JMSDeliveryMode: 2 JMSDeliveryDelay: 0 JMSDeliveryTime: 1404319379404 JMSExpiration: 0 JMSPriority: 4 JMSMessageID: ID:414d51204e54314d4148202020202020122fb45320002502 JMSTimestamp: 1404319379404 JMSCorrelationID: null JMSDestination: queue:///Q1 JMSReplyTo: null JMSRedelivered: false JMSXAppID: C:\Windows\System32\java.exe JMSXDeliveryCount: 0 JMSXUserID: hughson JMS_IBM_PutApplType: 11 JMS_IBM_PutDate: 20140702 JMS_IBM_PutTime: 16425944 My Message Text Enter some text to be sent in a message <ENTER to finish>: SUCCESS