Author |
Message
|
cynik |
Posted: Tue Mar 31, 2009 2:45 am Post subject: C# application connecting to QueueManager - set UserID |
|
|
Newbie
Joined: 31 Mar 2009 Posts: 9
|
I have C# application (Windows XP) using MQ client which connects to QueueManager (on AIX server). MQ is version 6.0
Everything works fine until i try to set another UserId and Password via properies MQEnvironment.UserId and MQEnvironment.Password - then I am getting 2035 not authorized error.
For example, I am trying to set UserId to "appluser" (which is member of mqm group on the AIX server). When I run the C# application under user "appluser" (run as..) then everything is ok, but when I set this user programatically in code -> the exception 2035 comes up.
Here is part of the code (doesn't work with commented lines):
// MQEnvironment.UserId = userName;
// MQEnvironment.Password = password;
MQEnvironment.Hostname = host;
MQEnvironment.Port = port;
MQEnvironment.Channel = channel;
MQQueueManager queueManager = new MQQueueManager(queueManagerName);
Am I doing something wrong? Pls  |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Mar 31, 2009 2:54 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You would need to use something like the managed .NET client...
Anything making use of the c MQ Client libraries will send the logged in user.
As a workaround do use contact admin.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
cynik |
Posted: Tue Mar 31, 2009 2:59 am Post subject: |
|
|
Newbie
Joined: 31 Mar 2009 Posts: 9
|
I am using managed MQ client (amqmdnet.dll).
And so far I am using "run as.." as a workaround, but it is not very convenient  |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Mar 31, 2009 3:06 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
cynik wrote: |
I am using managed MQ client (amqmdnet.dll).
And so far I am using "run as.." as a workaround, but it is not very convenient  |
May be I was not precise enough...
Managed MQ Client here refers to a client connection/transport mode. Not to a dll or coding practice.
amqmdnet.dll gets used in managed client and unmanaged client connection modes.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Mar 31, 2009 4:50 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I don't think there's any way to code .NET to allow you to manually specify a user id. Even with the managed connection.
.NET does not have the conceit of Java that it should run on any platform and ignore the OS.
The other option aside from Run As is to use SSL certificates and either MCAUSER or an exit to match certs with ids. |
|
Back to top |
|
 |
|