ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Security » Java Code to pass user id and password to connect to QM

Post new topic  Reply to topic
 Java Code to pass user id and password to connect to QM « View previous topic :: View next topic » 
Author Message
ikulm
PostPosted: Thu Sep 12, 2013 12:35 pm    Post subject: Java Code to pass user id and password to connect to QM Reply with quote

Newbie

Joined: 12 Sep 2013
Posts: 5

I have a java Web application which connects to queue manager from a WAS, I am trying to pass the details in
Code:
MQConfigManagerConnectionParameters localMQConfigManagerConnectionParameters = new MQConfigManagerConnectionParameters(
            paramString1, paramInt, paramString2);


The connection takes the user id and password of the underlying WAS. How can I pass my own user id and password?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Sep 12, 2013 12:39 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

What good would it do you to send a password?

MQ won't use it.

http://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/topic/com.ibm.mq.dev.doc/q030740_.htm
Back to top
View user's profile Send private message
exerk
PostPosted: Thu Sep 12, 2013 12:41 pm    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

Firstly, unless you have an exit on the SVRCONN being used, and that exit accepts the user and password, and that exit has a means to query whatever security module being used on the platform hosting the queue manager, e.g. Active Directory, flowing a password is pointless - WebSphere MQ itself will do nothing with it.

Secondly, I don't know how you set up WAS so it flows a particular userid, but I'm sure that someone will be along in a moment to tell you.

EDIT: Told you someone would be along soon...
_________________
It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
Back to top
View user's profile Send private message
ikulm
PostPosted: Thu Sep 12, 2013 1:40 pm    Post subject: Reply with quote

Newbie

Joined: 12 Sep 2013
Posts: 5

I read this post :
http://www.niratul.com/QueueManager.htm

Enter the class name of user-defined security exit's Client part written and compiled in Java. Please be sure to enter the exact class name with case-sensitive. This class name must have following two methods in it to set userid and password.

public void setUserId(String userid)

public void setPassword(String password)

WMQTool will pass userid and password using these two methods to this Client Security Exit class. You should use them in your class appropriately.

So I was thinking we can actually write a class in Java and pass as one of the parameter in the method
Back to top
View user's profile Send private message
bruce2359
PostPosted: Thu Sep 12, 2013 1:56 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

Do you have a security exit?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
ikulm
PostPosted: Thu Sep 12, 2013 1:59 pm    Post subject: Reply with quote

Newbie

Joined: 12 Sep 2013
Posts: 5

No I dont. How can I get it ?
Back to top
View user's profile Send private message
gbaddeley
PostPosted: Thu Sep 12, 2013 5:22 pm    Post subject: Reply with quote

Jedi Knight

Joined: 25 Mar 2003
Posts: 2538
Location: Melbourne, Australia

ikulm wrote:
No I dont. How can I get it ?

Do you actually have a security requirement that MQ must authenticate an application provided userid and password? Out of the box, current versions of MQ do not provide this feature. You would need to design and develop your own exits or purchase from an ISV.
There are other security controls that you can use to address MQ client security.
_________________
Glenn
Back to top
View user's profile Send private message
ikulm
PostPosted: Thu Sep 12, 2013 8:18 pm    Post subject: Reply with quote

Newbie

Joined: 12 Sep 2013
Posts: 5

I need to connect to the broker and get all the execution group and Message flow names within the broker. One part of it requires me to supply the connection properties. So are you saying there is a way around to g this information?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Sep 13, 2013 2:17 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

That's BROKER, and not MQ.

And it's, again, BROKER, and not MQ, that will validate the userid and password.

And just like you can't tell the Toolkit to connect to a Broker as some user other than the user running the Toolkit, you can't tell your java code to connect to a Broker as some user other than the user running the JVM.
Back to top
View user's profile Send private message
JosephGramig
PostPosted: Fri Sep 13, 2013 7:27 am    Post subject: Reply with quote

Grand Master

Joined: 09 Feb 2006
Posts: 1244
Location: Gold Coast of Florida, USA

This almost sounds like you are writing an Web application to administer/view the WMB configuration.

Is this what you are trying to do?

Did you know that several versions of WMB have a web interface?

What are you really trying to do?

BTW: It is almost certainly easier to use self signed SSL certificates and MQ Rules to control access than write your own exits (which are unlikely to be as robust).
Back to top
View user's profile Send private message AIM Address
ikulm
PostPosted: Fri Sep 13, 2013 10:56 am    Post subject: Reply with quote

Newbie

Joined: 12 Sep 2013
Posts: 5

Quote:
This almost sounds like you are writing an Web application to administer/view the WMB configuration.

Is this what you are trying to do?

Did you know that several versions of WMB have a web interface?

What are you really trying to do?

BTW: It is almost certainly easier to use self signed SSL certificates and MQ Rules to control access than write your own exits (which are unlikely to be as robust).


Yes, This is exactly I am trying to do. I am trying to pull the status of all the Message Flow within the execution group and show the status , whether it is in start state or stop state. This works fine from my local machine because my id have access to the broker but when i deploy this on WAS, the underlying user id does not have access to this WMB broker manager and fails to get authenticate.

IBM is not going to add generic user id, So I do not have a choice here.

If there is any way out, I am certainly not aware of. So will really appreciate if I can get some help over here.[/img]
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Sep 13, 2013 11:17 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

ikulm wrote:
If there is any way out, I am certainly not aware of. So will really appreciate if I can get some help over here.[/img]


Modern versions of the product are supported via web interfaces. A number of support pacs and commerical products (for example Aviva's IR360) provide web based access to the broker which lacks such IBM supplied functionality. So at best you're reinventing a wheel.


(No recommendation or endorsement of any product or solution is intended or implied, the fitness of any product or solution to a particular situation cannot be guaranteed and no liabiity is accepted for any loss incurred directly or indirectly from the use of information in this post.)

_________________
Honesty is the best policy.
Insanity is the best defence.


Last edited by Vitor on Fri Sep 13, 2013 11:18 am; edited 1 time in total
Back to top
View user's profile Send private message
JosephGramig
PostPosted: Fri Sep 13, 2013 11:17 am    Post subject: Reply with quote

Grand Master

Joined: 09 Feb 2006
Posts: 1244
Location: Gold Coast of Florida, USA

The simple answer is:
  1. Create a self signed CA key store
  2. Create Qmgr key store
  3. Create Qmgr cert request
  4. Have self signed CA sign QMgr cert request
  5. Have Qmgr receive signed cert request
  6. Create WAS client key store
  7. Create WAS client cert request
  8. Have self signed CA sign WAS client cert request
  9. Have WAS Client receive signed cert request
  10. Build specific SVRCONN for WAS Client that specifies MCAUSER and SSLPEER to ensure only this cert is used (maybe use the CN value in the DN)
  11. Config WAS for this app server to use this specific channel for connections

Something like that... If you have CHLAUTH rules, then use them to map the ID off something in the SSL.

Or use the web interface that comes with WMB?
What version of WMB is this?
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Security » Java Code to pass user id and password to connect to QM
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.