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 Java / JMS » Java jms authorization not working

Post new topic  Reply to topic
 Java jms authorization not working « View previous topic :: View next topic » 
Author Message
tobix10
PostPosted: Wed Aug 21, 2013 5:23 am    Post subject: Java jms authorization not working Reply with quote

Newbie

Joined: 21 Aug 2013
Posts: 2

Hello, I have a strange problem with my java code which sends simple jms text message to the queue. Finally I've figured out how to use mcauser property, but it seems that java don't respect this settings.

When I try to put messages from samp amqsput on different account(not mcauser one) I got error code, but when I send it from java there is no exception and every msg is transported to the queue.

Let me explain how my architecture looks like and what I configured.

Architecture: java_producer ---> remote1 ---> remote2 ---> local ---> java_consumer
QUEUES are on LINUX, I try to connect from WINDOWS.

User: mqtest group: mqqueues

In java_producer class I use JNDI bindings and pass user login and password to connection function:
Code:
JmsConnectionFactory cf = (JmsConnectionFactory) context.lookup(conFactory);
connection = cf.createConnection(login, pass);


My JNDI bindings points to remote1 through the svrconn channel with mcauser('mqtest').
In the runmqsc interpreter I switch on CHLAUTH for QMGR of remote1 point, also tried to REFRESH SECURITY.

I didn't change default security settings, but added only access for group mqqueues.

Code:
setmqaut -m MYQMGR -t qmgr -g mqqueues -all +inq +connect

Code:
setmqaut -m MYQMGR -t queue -g mqqueues -n MYREMOTE1 -all +put +inq


I checked these with dspmqaut, everything seems fine.

Any suggestions? Does user login and password determine user id?
How can I check what user id connected to the queue?
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Aug 21, 2013 5:46 am    Post subject: Re: Java jms authorization not working Reply with quote

Grand High Poobah

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

tobix10 wrote:
Any suggestions? Does user login and password determine user id?
How can I check what user id connected to the queue?


WMQ never uses a password; it authorises but does not authenticate. You'll find a raft of discussion on this in the forum with the search facility (top right of this page)

It also doesn't use the logged on user id but the user id passed to it. Commonly, Java a blank user id so WMQ is forced to fill in the blank with the only id it has - the id of the channel receiving the message from Java. Typicaly this is the mqm "super user" so you don't get security violations. You'll find a raft of discussion on this as well.

It's best practice to always use MCAUser on a client connection and Java shouldn't be able to ignore it. I'm not a Java person, but are you sure that JNDI is using the channel you think it is?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Aug 21, 2013 3:39 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

if you use the form cf.createConnection(userid,pwd) the userid will be passed to the channel. It may be meaningless if you have an MCAUser set on the channel.

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
tobix10
PostPosted: Wed Aug 21, 2013 11:05 pm    Post subject: Re: Java jms authorization not working Reply with quote

Newbie

Joined: 21 Aug 2013
Posts: 2

Vitor wrote:
I'm not a Java person, but are you sure that JNDI is using the channel you think it is?

Yes, I'm sure.

fjb_saper wrote:
if you use the form cf.createConnection(userid,pwd) the userid will be passed to the channel. It may be meaningless if you have an MCAUser set on the channel.

I am not convinced about this now. It looks like
Vitor says: "Java passes blank user id".

I will search about this. Thanks for reply.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Aug 22, 2013 4:38 am    Post subject: Re: Java jms authorization not working Reply with quote

Grand High Poobah

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

tobix10 wrote:
Vitor wrote:
I'm not a Java person, but are you sure that JNDI is using the channel you think it is?

Yes, I'm sure.


Take your word over mine when it comes to Java
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Aug 23, 2013 10:20 am    Post subject: Re: Java jms authorization not working Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

tobix10 wrote:
Vitor wrote:
I'm not a Java person, but are you sure that JNDI is using the channel you think it is?

Yes, I'm sure.

fjb_saper wrote:
if you use the form cf.createConnection(userid,pwd) the userid will be passed to the channel. It may be meaningless if you have an MCAUser set on the channel.

I am not convinced about this now. It looks like
Vitor says: "Java passes blank user id".

I will search about this. Thanks for reply.

fjb_saper wrote:
if you use the form cf.createConnection(userid,pwd) the userid will be passed to the channel. It may be meaningless if you have an MCAUser set on the channel.


What Vitor was referring to was the other form of the method:
Code:
cf.createConnection()


Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Java jms authorization not working
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.