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 » Provide userid in C and VB

Post new topic  Reply to topic
 Provide userid in C and VB « View previous topic :: View next topic » 
Author Message
Henry
PostPosted: Sat Nov 01, 2003 9:14 pm    Post subject: Provide userid in C and VB Reply with quote

Acolyte

Joined: 08 Oct 2003
Posts: 73

Hi!

I would like to ask how can I provide userid in C and VB in order to connect to the queue and qmanager? The C programme is running in Solaris and Windows NT.

How should I code for the userid and password in my programme in C, VB in order to connect the queue manager and open the queue?

Many thanks!!

Back to top
View user's profile Send private message
JasonE
PostPosted: Tue Nov 04, 2003 2:38 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

Without security exits in place, the client always sends over the signed on userid on Unix and Windows, so you have no control over what userid is used. You can use alternate userids once connected (if +altusr authorized) but you cannot change what the connect is done with.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Nov 04, 2003 5:32 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

JasonE wrote:
Without security exits in place, the client always sends over the signed on userid on Unix and Windows, so you have no control over what userid is used. You can use alternate userids once connected (if +altusr authorized) but you cannot change what the connect is done with.
Unless of course, your program changes what user it is running as before it makes the connection.

Code to do this is left as an exercise...
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Henry
PostPosted: Tue Nov 04, 2003 8:14 pm    Post subject: Reply with quote

Acolyte

Joined: 08 Oct 2003
Posts: 73

In java code, there is an API call to give the userid

MQEnvironment.userID = "<userid>"

is there any API call in C or VB like the java one?
Back to top
View user's profile Send private message
JasonE
PostPosted: Wed Nov 05, 2003 1:51 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

No. I think the only reason you can do it in java is because getting the signed on userid is unreliable (a system property which I think is unreadable from an applet).
Back to top
View user's profile Send private message
vanvught
PostPosted: Sun Nov 09, 2003 5:33 am    Post subject: Reply with quote

Apprentice

Joined: 02 Jul 2001
Posts: 35
Location: The Netherlands

In C you have:

Code:
struct tagMQOD {
   MQCHAR4   StrucId;              /* Structure identifier */
   MQLONG    Version;              /* Structure version number */
   MQLONG    ObjectType;           /* Object type */
   MQCHAR48  ObjectName;           /* Object name */
   MQCHAR48  ObjectQMgrName;       /* Object queue manager name */
   MQCHAR48  DynamicQName;         /* Dynamic queue name */
   MQCHAR12  AlternateUserId;      /* Alternate user identifier */


Quote:
AlternateUserId (MQCHAR12)
Alternate user identifier.

If MQOO_ALTERNATE_USER_AUTHORITY is specified for the MQOPEN call, or MQPMO_ALTERNATE_USER_AUTHORITY for the MQPUT1 call, this field contains an alternate user identifier that is to be used to check the authorization for the open, in place of the user identifier that the application is currently running under. Some checks, however, are still carried out with the current user identifier (for example, context checks).

If MQOO_ALTERNATE_USER_AUTHORITY or MQPMO_ALTERNATE_USER_AUTHORITY is specified and this field is entirely blank up to the first null character or the end of the field, the open can succeed only if no user authorization is needed to open this object with the options specified.

If neither MQOO_ALTERNATE_USER_AUTHORITY nor MQPMO_ALTERNATE_USER_AUTHORITY is specified, this field is ignored.


Regards, Arjan
WBI: B2B and WebSphere MQ --> http://edi.services.ibm.com/mqseries/spec_sheets.shtml
Back to top
View user's profile Send private message
JasonE
PostPosted: Mon Nov 10, 2003 12:59 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

Yes, but dont forget alternate id's dont affect connects and require the userid connecting to be authorized to use alternate userid.

The Java equivalent sets the userid on the connect, which is slightly different.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Provide userid in C and VB
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.