users@glassfish.java.net

JMS Standalone Client Authentication using user and password

From: <glassfish_at_javadesktop.org>
Date: Tue, 14 Aug 2007 22:42:45 PDT

In my standalone application with most JMS providers I can use:
topicConnectionFactory.createTopicConnection(user,password)
thus having client code pass in user and password. With default glassfish install (with guest/guest in Admin JMS and MQ) the setup is "container authentication", and the user/password for JMS is set using Admin web console. I know how to add additional users/password to MQ, but how do I "switch on" application authentication for my "remote standalone" application? What do I need to do to use createTopicConnection(user,password) instead of createTopicConnection()?

With createTopicConnection(user,password) I get the

MQRA:MC:Warning:createConnection API used w/ username, password for Container Auth

I found someone had posted the code snippet containing the println:
(what makes pwcValid = false?)

---- code snippet with the two types of createConnection.
if (pwcValid) {
                //CONT AUTH case - app must not use createConnection(u, p);
                if (cxRequestInfo.getUserName() != null) {
                    System.err.println("MQRA:MC:Warning:createConnection API used w/ username, password for Container Auth");
                }
            } else {
                //APP AUTH case - app must use createConnection(u, p);
                if (cxRequestInfo.getUserName() == null) {
                    System.err.println("MQRA:MC:Warning:createConnection API used w/o username, password for Application Auth");
                }
            }
[Message sent by forum member 'steveshell' (steveshell)]

http://forums.java.net/jive/thread.jspa?messageID=230928