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 API Support » Alternate UserId

Post new topic  Reply to topic Goto page 1, 2  Next
 Alternate UserId « View previous topic :: View next topic » 
Author Message
msantos007
PostPosted: Thu Mar 23, 2006 7:58 am    Post subject: Alternate UserId Reply with quote

Voyager

Joined: 20 Dec 2004
Posts: 78

Hello there,

I´m trying to write an application where i can specify the userid to connect to a queue manager. The application will be written in C#, and I tried to set MQEnvironment.UserId and MQEnvironment.Password to the values of my username and Id. This user is in the mqm group, but I get the ReasonCode 2035 when I try to connect to the queue manager.
Questions:
1-) Can I alter these values to do what I´m planning?
2-) If yes, am I doing it in the right way?
3-) Is there anything I have to do to write an app in this way?
_________________
Maximiliano R. A. Santos
IBM Websphere MQ V6.0 Certified System Administrator
IBM Websphere MQ V5.3 Certified Solution Developer
Back to top
View user's profile Send private message MSN Messenger
jefflowrey
PostPosted: Thu Mar 23, 2006 8:01 am    Post subject: Re: Alternate UserId Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

msantos007 wrote:
Hello there,

I´m trying to write an application where i can specify the userid to connect to a queue manager. The application will be written in C#, and I tried to set MQEnvironment.UserId and MQEnvironment.Password to the values of my username and Id. This user is in the mqm group, but I get the ReasonCode 2035 when I try to connect to the queue manager.
Questions:
1-) Can I alter these values to do what I´m planning?

Not that I know of. As far as I know, the only APIs that do not automatically pass on the user id that the program is running under is the Java API( both MQ and JMS) - and only because they have to be written to be 100% pure java and there is no 100% pure Java way to get the user from the OS.
msantos007 wrote:
2-) If yes, am I doing it in the right way?
3-) Is there anything I have to do to write an app in this way?

You'll have to look into forking a process that runs as another user.

Or read about the Alternate User ID permissions in MQ, and how those are handled and used.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
msantos007
PostPosted: Thu Mar 23, 2006 8:04 am    Post subject: Reply with quote

Voyager

Joined: 20 Dec 2004
Posts: 78

it´s kinda weird,

the app server runs under ASPNET user, so do my application, and I put it in the mqm group
I try to connect without the user and password value sets and bingo! I my connection is successfull, and when I set the user name and password .,,, 2035
_________________
Maximiliano R. A. Santos
IBM Websphere MQ V6.0 Certified System Administrator
IBM Websphere MQ V5.3 Certified Solution Developer
Back to top
View user's profile Send private message MSN Messenger
mvic
PostPosted: Thu Mar 23, 2006 8:12 am    Post subject: Re: Alternate UserId Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

msantos007 wrote:
MQEnvironment.UserId and MQEnvironment.Password

Did you read up on what those parameters do? They probably don't do what you think they do.

As for putting users in the mqm group... hopefully you won't do this in production. mqm group is for MQ administrators.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Mar 23, 2006 8:16 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

What happens when you set the UserId and Password to the ASPNET user?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
msantos007
PostPosted: Thu Mar 23, 2006 9:56 am    Post subject: Reply with quote

Voyager

Joined: 20 Dec 2004
Posts: 78

mvic mqm group is for wmq administrators, actually
when we need someone to execute administrative tasks
on wmq, we put that user as member of the mqm group.
About the parameter´s the Using .NET manual only says

MQQueueManager Class
Password(page 33)
public static String Password {get; set;}
The password to be authenticated.

UserId (page 34)
public static String UserId {get; set;}
The UserId to be authenticated.

I don´t know what happens if I set the userid ASPNET, because I don´t know what´s its password, and maybe my IIS stop working

But the thing is: If I don´t set any parameters, My connection is ok
if I set the parameters(even if I use an administrator account or an mqm acount) I have reason code 2035 (MQRC_NOT_AUTHORIZED) and the Event Viewer says, the user 'user' doesn´t have enough authority to do this.


_________________
Maximiliano R. A. Santos
IBM Websphere MQ V6.0 Certified System Administrator
IBM Websphere MQ V5.3 Certified Solution Developer
Back to top
View user's profile Send private message MSN Messenger
jefflowrey
PostPosted: Thu Mar 23, 2006 10:06 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Well, if you don't know the password for ASPNET, set it to a user that is in mqm that you do know the password for.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
msantos007
PostPosted: Thu Mar 23, 2006 10:11 am    Post subject: Reply with quote

Voyager

Joined: 20 Dec 2004
Posts: 78

I did it, and returns 2035 anyway

do I have to set any kind of default layout for user, like
mqm@server or server\mqm ...
_________________
Maximiliano R. A. Santos
IBM Websphere MQ V6.0 Certified System Administrator
IBM Websphere MQ V5.3 Certified Solution Developer
Back to top
View user's profile Send private message MSN Messenger
mvic
PostPosted: Thu Mar 23, 2006 10:21 am    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

msantos007 wrote:
MQQueueManager Class
Password(page 33)
public static String Password {get; set;}
The password to be authenticated.

UserId (page 34)
public static String UserId {get; set;}
The UserId to be authenticated.

Not exactly a useful description, is it?

Try
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.amqwag.doc/mqzautu.htm
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzas.doc/sp1wounwi.htm
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzak.doc/csqzak1073.htm
Back to top
View user's profile Send private message
msantos007
PostPosted: Thu Mar 23, 2006 11:34 am    Post subject: Reply with quote

Voyager

Joined: 20 Dec 2004
Posts: 78

Am I insane or someone also tried something like
this before?
_________________
Maximiliano R. A. Santos
IBM Websphere MQ V6.0 Certified System Administrator
IBM Websphere MQ V5.3 Certified Solution Developer
Back to top
View user's profile Send private message MSN Messenger
jefflowrey
PostPosted: Thu Mar 23, 2006 11:40 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You know that IIS lets you change what user a particular web page and etc. runs as, right? That you can configure IIS to authenticate your users itself, and then the ASPs that the user accesses will run as that windows user, rather than as ASPNET? Similarly, you can configure IIS to run a particular ASP as a fixed user...

Also, again - as you've seen - the MQEnvironment.UserID and Password do not do what you think they do in .NET. They only work that way in Java.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
msantos007
PostPosted: Thu Mar 23, 2006 11:43 am    Post subject: Reply with quote

Voyager

Joined: 20 Dec 2004
Posts: 78

I´m trying to use this to connect to different queue managers, in different operating systems without fixing the MCAUSER at my SVRCONN channels
_________________
Maximiliano R. A. Santos
IBM Websphere MQ V6.0 Certified System Administrator
IBM Websphere MQ V5.3 Certified Solution Developer
Back to top
View user's profile Send private message MSN Messenger
jefflowrey
PostPosted: Thu Mar 23, 2006 11:52 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Then you need to look into forking and changing effective user ids in some manner or another.

MQ does this using DCOM objects.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Mar 23, 2006 11:54 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

On the flip side, if you're looking to build a web-based administration tool...

You can look at installing a local qmgr on the web server, and configuring sdr/rcvr channels (possibly with SSL) to all the different qmgrs - and then using PCF through remote queues to the various command server queues.

Or you can look at running local agent processes on each managed qmgr, and using regular TCP/IP to talk to those agent processes.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
msantos007
PostPosted: Thu Mar 23, 2006 12:08 pm    Post subject: Reply with quote

Voyager

Joined: 20 Dec 2004
Posts: 78

I have a new idea,
what if I create a user in each system with permissions only to connect to queue managers. He won´t have permissions to open queues or put messages, but I can set an alternate user on open and put/get calls to a user that has this permissions. You can say 'why is that? I´m calling an ambulance!' the answer is, If the user of the web application doesn´t give me an valid user ID he cannot put messages on my queues even if he´s connected to the queue manager.
_________________
Maximiliano R. A. Santos
IBM Websphere MQ V6.0 Certified System Administrator
IBM Websphere MQ V5.3 Certified Solution Developer
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ API Support » Alternate UserId
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.