Topic
  • 3 replies
  • Latest Post - ‏2017-07-17T08:59:25Z by MoragH
brai
brai
3 Posts

Pinned topic Accounting Token

‏2017-07-14T13:41:49Z | accounting mq mqmd token windows

Hi,

 

I am trying to set the MQMD header for a client. I have managed to open the queue and set ApplIdentitydata and user Id. However the accounting token is giving us some problems. 

For Windows it states that the token is a 32 byte array, first and last have some logic and the 30 in between will be set from the Windows SID excluding the Authority Id. 

The problem is that our SID converted to bytes has a length of over 40 (minus the 6 byte array authority Id) still greater than the expected 30.

 

Please could you help and let me know if I am converting the SID incorrectly or if there is anything else that might need to be done?

 

Thank you!

  • MoragH
    MoragH
    131 Posts

    Re: Accounting Token

    ‏2017-07-14T22:30:29Z  

    Normally it is not necessary to set these fields in the MQMD. You can simply let the queue manager set them.

    The only time you need to set them is when you use the option MQOO_SET_IDENTITY_CONTEXT (or MQOO_SET_ALL_CONTEXT) and then on the MQPUT the equivalent MQPMO_SET_*_CONTEXT option). Are you doing this? What is the reason you are doing this?

    Also, the description of the Accounting Token that you are reading is describing how the queue manager will carry the SID in a message. It is not specifically instructions that you must must fill in when putting your own message. Unless you have some special reason to be mimicing what the queue manager does automatically for you?

    Cheers,
    Morag

  • brai
    brai
    3 Posts

    Re: Accounting Token

    ‏2017-07-17T08:06:56Z  
    • MoragH
    • ‏2017-07-14T22:30:29Z

    Normally it is not necessary to set these fields in the MQMD. You can simply let the queue manager set them.

    The only time you need to set them is when you use the option MQOO_SET_IDENTITY_CONTEXT (or MQOO_SET_ALL_CONTEXT) and then on the MQPUT the equivalent MQPMO_SET_*_CONTEXT option). Are you doing this? What is the reason you are doing this?

    Also, the description of the Accounting Token that you are reading is describing how the queue manager will carry the SID in a message. It is not specifically instructions that you must must fill in when putting your own message. Unless you have some special reason to be mimicing what the queue manager does automatically for you?

    Cheers,
    Morag

    Hi Morag,

     

    Thank you for your quick reply. 

    Yes I am using the SET_IDENTITY_CONTEXT option, we are doing this as our client needs to set a username and password in the ApplIdentitydata field and once we do this the queue manager does not automatically set user Id or Accounting Token. As these are not set automatically we wanted to mimic the queue manager.

     

    Best wishes,

    Brai

  • MoragH
    MoragH
    131 Posts

    Re: Accounting Token

    ‏2017-07-17T08:59:25Z  

    I'm still not 100% certain I understand why you can't just send the user id and not bother with the SID. I imagine the queue manager will look up the user ID to obtain the SID if it needs it.

    However, if you have already determined from your testing that the SID must be supplied, may I suggest you try putting a message with the same user ID that you need the SID for and allowing the queue manager to fill in these fields, and then inspect what it puts in there? That may shed some light on the format. It says "compressed SID format" but I don't know what that means exactly.

    Cheers,
    Morag