Strange problem with authentication on IBMMQ, it takes the running user ID











up vote
1
down vote

favorite












I've got a strange problem when I perform a push of a message in a queue. I've configured my application to read userid/password from app.config. when the message is put on the queue I got the username of the user that has run the application and it's the one of the .config file.



The code I use to create the MQQueueManager is



  private static readonly Lazy<MQQueueManager> lazy =
new Lazy<MQQueueManager>(() =>
{
var properties = new Hashtable();

var container = ContainerWrapper.Container;

IConfiguration configuration = container.GetInstance<IConfiguration>();

properties.Add(MQC.HOST_NAME_PROPERTY, configuration.GetValue<string>("HOST_NAME_PROPERTY"));
properties.Add(MQC.PORT_PROPERTY, configuration.GetValue<int>("PORT_PROPERTY"));
properties.Add(MQC.USER_ID_PROPERTY, configuration.GetValue<string>("USER_ID_PROPERTY"));
properties.Add(MQC.PASSWORD_PROPERTY, configuration.GetValue<string>("PASSWORD_PROPERTY"));
properties.Add(MQC.CHANNEL_PROPERTY, configuration.GetValue<string>("CHANNEL_PROPERTY"));


MQQueueManager queueManager = new MQQueueManager(configuration.GetValue<string>("QUEUE_MANAGER_NAME"), properties);


return queueManager;
});


Am I missing something?
Thanks in advance










share|improve this question


























    up vote
    1
    down vote

    favorite












    I've got a strange problem when I perform a push of a message in a queue. I've configured my application to read userid/password from app.config. when the message is put on the queue I got the username of the user that has run the application and it's the one of the .config file.



    The code I use to create the MQQueueManager is



      private static readonly Lazy<MQQueueManager> lazy =
    new Lazy<MQQueueManager>(() =>
    {
    var properties = new Hashtable();

    var container = ContainerWrapper.Container;

    IConfiguration configuration = container.GetInstance<IConfiguration>();

    properties.Add(MQC.HOST_NAME_PROPERTY, configuration.GetValue<string>("HOST_NAME_PROPERTY"));
    properties.Add(MQC.PORT_PROPERTY, configuration.GetValue<int>("PORT_PROPERTY"));
    properties.Add(MQC.USER_ID_PROPERTY, configuration.GetValue<string>("USER_ID_PROPERTY"));
    properties.Add(MQC.PASSWORD_PROPERTY, configuration.GetValue<string>("PASSWORD_PROPERTY"));
    properties.Add(MQC.CHANNEL_PROPERTY, configuration.GetValue<string>("CHANNEL_PROPERTY"));


    MQQueueManager queueManager = new MQQueueManager(configuration.GetValue<string>("QUEUE_MANAGER_NAME"), properties);


    return queueManager;
    });


    Am I missing something?
    Thanks in advance










    share|improve this question
























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I've got a strange problem when I perform a push of a message in a queue. I've configured my application to read userid/password from app.config. when the message is put on the queue I got the username of the user that has run the application and it's the one of the .config file.



      The code I use to create the MQQueueManager is



        private static readonly Lazy<MQQueueManager> lazy =
      new Lazy<MQQueueManager>(() =>
      {
      var properties = new Hashtable();

      var container = ContainerWrapper.Container;

      IConfiguration configuration = container.GetInstance<IConfiguration>();

      properties.Add(MQC.HOST_NAME_PROPERTY, configuration.GetValue<string>("HOST_NAME_PROPERTY"));
      properties.Add(MQC.PORT_PROPERTY, configuration.GetValue<int>("PORT_PROPERTY"));
      properties.Add(MQC.USER_ID_PROPERTY, configuration.GetValue<string>("USER_ID_PROPERTY"));
      properties.Add(MQC.PASSWORD_PROPERTY, configuration.GetValue<string>("PASSWORD_PROPERTY"));
      properties.Add(MQC.CHANNEL_PROPERTY, configuration.GetValue<string>("CHANNEL_PROPERTY"));


      MQQueueManager queueManager = new MQQueueManager(configuration.GetValue<string>("QUEUE_MANAGER_NAME"), properties);


      return queueManager;
      });


      Am I missing something?
      Thanks in advance










      share|improve this question













      I've got a strange problem when I perform a push of a message in a queue. I've configured my application to read userid/password from app.config. when the message is put on the queue I got the username of the user that has run the application and it's the one of the .config file.



      The code I use to create the MQQueueManager is



        private static readonly Lazy<MQQueueManager> lazy =
      new Lazy<MQQueueManager>(() =>
      {
      var properties = new Hashtable();

      var container = ContainerWrapper.Container;

      IConfiguration configuration = container.GetInstance<IConfiguration>();

      properties.Add(MQC.HOST_NAME_PROPERTY, configuration.GetValue<string>("HOST_NAME_PROPERTY"));
      properties.Add(MQC.PORT_PROPERTY, configuration.GetValue<int>("PORT_PROPERTY"));
      properties.Add(MQC.USER_ID_PROPERTY, configuration.GetValue<string>("USER_ID_PROPERTY"));
      properties.Add(MQC.PASSWORD_PROPERTY, configuration.GetValue<string>("PASSWORD_PROPERTY"));
      properties.Add(MQC.CHANNEL_PROPERTY, configuration.GetValue<string>("CHANNEL_PROPERTY"));


      MQQueueManager queueManager = new MQQueueManager(configuration.GetValue<string>("QUEUE_MANAGER_NAME"), properties);


      return queueManager;
      });


      Am I missing something?
      Thanks in advance







      c# ibm-mq






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Oct 22 at 8:14









      advapi

      1,00311129




      1,00311129
























          2 Answers
          2






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          In order for your connection to run as the user ID and password provided on the connect, you must configure the queue manager to check the user ID and password and also you must configure the queue manager to adopt the validated user ID.



          DISPLAY QMGR CONNAUTH


          The value in the CONNAUTH field is the name of an AUTHINFO object. If it is blank, user ID and password checking is not enabled. Set it to an appropriate object name.



          ALTER QMGR CONNAUTH(SYSTEM.DEFAULT.AUTHINFO.IDPWOS)


          Now look at the attributes of it.



          DISPLAY AUTHINFO(name-from-connauth) ALL


          If ADOPTCTK is set to NO, the the user ID will not be adopted as the connection's user ID, and so will not be seen in the message context.



          ALTER AUTHINFO(name-from-connauth) AUTHTYPE(IDPWOS) ADOPTCTX(YES)


          If you had to make any alterations, you must now issue this command.



          REFRESH SECURITY TYPE(CONNAUTH)





          share|improve this answer























          • Excuse me Morag, whate have I to pass as name-from-connauth ? the username?
            – advapi
            Oct 22 at 15:04










          • The name that was displayed in the CONNAUTH field from the earlier DISPLAY command, or if blank, the name you set into it with the ALTER command.
            – Morag Hughson
            Oct 22 at 19:36










          • Hello, I got this message AMQ8427: Valid syntax for the MQSC command: ALTER AUTHINFO( authinfo_name ) AUTHTYPE( CRLLDAP | OCSP | IDPWOS | IDPWLDAP ) I'm using IBMMQ 8
            – advapi
            Oct 23 at 14:13












          • Oops, my apologies - typo in command (did from memory). Have corrected answer.
            – Morag Hughson
            Oct 24 at 1:46


















          up vote
          -1
          down vote













          You probably need to add another line to your properties.



          Try (from memory so you will need to find the correct constant)
          USE_MQCSP_USERNAME_PASSWORD This should be a boolean and should be set to yes....



          Add this to your properties, then create the queue manager with those properties.






          share|improve this answer





















          • Welcome to SO, it is better to write a answer to something you specifically have knowledge of or have researched than to provide a answer to something you are not certain of (ex: from memory). This is C# he is asking about and while it does have a property similar to what you mentioned, unlike Java it appears to be ignored and if the the USERID and PASSWORD are specified a MQCSP is generated no matter if the MQCSP property is set or not. @Morag already provided the likely answer that MQ by default on the Qmgr after authenticating the ID/PW will use the user the process ran as for OAM checks.
            – JoshMc
            Oct 24 at 21:27













          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52924929%2fstrange-problem-with-authentication-on-ibmmq-it-takes-the-running-user-id%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote



          accepted










          In order for your connection to run as the user ID and password provided on the connect, you must configure the queue manager to check the user ID and password and also you must configure the queue manager to adopt the validated user ID.



          DISPLAY QMGR CONNAUTH


          The value in the CONNAUTH field is the name of an AUTHINFO object. If it is blank, user ID and password checking is not enabled. Set it to an appropriate object name.



          ALTER QMGR CONNAUTH(SYSTEM.DEFAULT.AUTHINFO.IDPWOS)


          Now look at the attributes of it.



          DISPLAY AUTHINFO(name-from-connauth) ALL


          If ADOPTCTK is set to NO, the the user ID will not be adopted as the connection's user ID, and so will not be seen in the message context.



          ALTER AUTHINFO(name-from-connauth) AUTHTYPE(IDPWOS) ADOPTCTX(YES)


          If you had to make any alterations, you must now issue this command.



          REFRESH SECURITY TYPE(CONNAUTH)





          share|improve this answer























          • Excuse me Morag, whate have I to pass as name-from-connauth ? the username?
            – advapi
            Oct 22 at 15:04










          • The name that was displayed in the CONNAUTH field from the earlier DISPLAY command, or if blank, the name you set into it with the ALTER command.
            – Morag Hughson
            Oct 22 at 19:36










          • Hello, I got this message AMQ8427: Valid syntax for the MQSC command: ALTER AUTHINFO( authinfo_name ) AUTHTYPE( CRLLDAP | OCSP | IDPWOS | IDPWLDAP ) I'm using IBMMQ 8
            – advapi
            Oct 23 at 14:13












          • Oops, my apologies - typo in command (did from memory). Have corrected answer.
            – Morag Hughson
            Oct 24 at 1:46















          up vote
          2
          down vote



          accepted










          In order for your connection to run as the user ID and password provided on the connect, you must configure the queue manager to check the user ID and password and also you must configure the queue manager to adopt the validated user ID.



          DISPLAY QMGR CONNAUTH


          The value in the CONNAUTH field is the name of an AUTHINFO object. If it is blank, user ID and password checking is not enabled. Set it to an appropriate object name.



          ALTER QMGR CONNAUTH(SYSTEM.DEFAULT.AUTHINFO.IDPWOS)


          Now look at the attributes of it.



          DISPLAY AUTHINFO(name-from-connauth) ALL


          If ADOPTCTK is set to NO, the the user ID will not be adopted as the connection's user ID, and so will not be seen in the message context.



          ALTER AUTHINFO(name-from-connauth) AUTHTYPE(IDPWOS) ADOPTCTX(YES)


          If you had to make any alterations, you must now issue this command.



          REFRESH SECURITY TYPE(CONNAUTH)





          share|improve this answer























          • Excuse me Morag, whate have I to pass as name-from-connauth ? the username?
            – advapi
            Oct 22 at 15:04










          • The name that was displayed in the CONNAUTH field from the earlier DISPLAY command, or if blank, the name you set into it with the ALTER command.
            – Morag Hughson
            Oct 22 at 19:36










          • Hello, I got this message AMQ8427: Valid syntax for the MQSC command: ALTER AUTHINFO( authinfo_name ) AUTHTYPE( CRLLDAP | OCSP | IDPWOS | IDPWLDAP ) I'm using IBMMQ 8
            – advapi
            Oct 23 at 14:13












          • Oops, my apologies - typo in command (did from memory). Have corrected answer.
            – Morag Hughson
            Oct 24 at 1:46













          up vote
          2
          down vote



          accepted







          up vote
          2
          down vote



          accepted






          In order for your connection to run as the user ID and password provided on the connect, you must configure the queue manager to check the user ID and password and also you must configure the queue manager to adopt the validated user ID.



          DISPLAY QMGR CONNAUTH


          The value in the CONNAUTH field is the name of an AUTHINFO object. If it is blank, user ID and password checking is not enabled. Set it to an appropriate object name.



          ALTER QMGR CONNAUTH(SYSTEM.DEFAULT.AUTHINFO.IDPWOS)


          Now look at the attributes of it.



          DISPLAY AUTHINFO(name-from-connauth) ALL


          If ADOPTCTK is set to NO, the the user ID will not be adopted as the connection's user ID, and so will not be seen in the message context.



          ALTER AUTHINFO(name-from-connauth) AUTHTYPE(IDPWOS) ADOPTCTX(YES)


          If you had to make any alterations, you must now issue this command.



          REFRESH SECURITY TYPE(CONNAUTH)





          share|improve this answer














          In order for your connection to run as the user ID and password provided on the connect, you must configure the queue manager to check the user ID and password and also you must configure the queue manager to adopt the validated user ID.



          DISPLAY QMGR CONNAUTH


          The value in the CONNAUTH field is the name of an AUTHINFO object. If it is blank, user ID and password checking is not enabled. Set it to an appropriate object name.



          ALTER QMGR CONNAUTH(SYSTEM.DEFAULT.AUTHINFO.IDPWOS)


          Now look at the attributes of it.



          DISPLAY AUTHINFO(name-from-connauth) ALL


          If ADOPTCTK is set to NO, the the user ID will not be adopted as the connection's user ID, and so will not be seen in the message context.



          ALTER AUTHINFO(name-from-connauth) AUTHTYPE(IDPWOS) ADOPTCTX(YES)


          If you had to make any alterations, you must now issue this command.



          REFRESH SECURITY TYPE(CONNAUTH)






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Oct 24 at 1:46

























          answered Oct 22 at 10:58









          Morag Hughson

          4,360531




          4,360531












          • Excuse me Morag, whate have I to pass as name-from-connauth ? the username?
            – advapi
            Oct 22 at 15:04










          • The name that was displayed in the CONNAUTH field from the earlier DISPLAY command, or if blank, the name you set into it with the ALTER command.
            – Morag Hughson
            Oct 22 at 19:36










          • Hello, I got this message AMQ8427: Valid syntax for the MQSC command: ALTER AUTHINFO( authinfo_name ) AUTHTYPE( CRLLDAP | OCSP | IDPWOS | IDPWLDAP ) I'm using IBMMQ 8
            – advapi
            Oct 23 at 14:13












          • Oops, my apologies - typo in command (did from memory). Have corrected answer.
            – Morag Hughson
            Oct 24 at 1:46


















          • Excuse me Morag, whate have I to pass as name-from-connauth ? the username?
            – advapi
            Oct 22 at 15:04










          • The name that was displayed in the CONNAUTH field from the earlier DISPLAY command, or if blank, the name you set into it with the ALTER command.
            – Morag Hughson
            Oct 22 at 19:36










          • Hello, I got this message AMQ8427: Valid syntax for the MQSC command: ALTER AUTHINFO( authinfo_name ) AUTHTYPE( CRLLDAP | OCSP | IDPWOS | IDPWLDAP ) I'm using IBMMQ 8
            – advapi
            Oct 23 at 14:13












          • Oops, my apologies - typo in command (did from memory). Have corrected answer.
            – Morag Hughson
            Oct 24 at 1:46
















          Excuse me Morag, whate have I to pass as name-from-connauth ? the username?
          – advapi
          Oct 22 at 15:04




          Excuse me Morag, whate have I to pass as name-from-connauth ? the username?
          – advapi
          Oct 22 at 15:04












          The name that was displayed in the CONNAUTH field from the earlier DISPLAY command, or if blank, the name you set into it with the ALTER command.
          – Morag Hughson
          Oct 22 at 19:36




          The name that was displayed in the CONNAUTH field from the earlier DISPLAY command, or if blank, the name you set into it with the ALTER command.
          – Morag Hughson
          Oct 22 at 19:36












          Hello, I got this message AMQ8427: Valid syntax for the MQSC command: ALTER AUTHINFO( authinfo_name ) AUTHTYPE( CRLLDAP | OCSP | IDPWOS | IDPWLDAP ) I'm using IBMMQ 8
          – advapi
          Oct 23 at 14:13






          Hello, I got this message AMQ8427: Valid syntax for the MQSC command: ALTER AUTHINFO( authinfo_name ) AUTHTYPE( CRLLDAP | OCSP | IDPWOS | IDPWLDAP ) I'm using IBMMQ 8
          – advapi
          Oct 23 at 14:13














          Oops, my apologies - typo in command (did from memory). Have corrected answer.
          – Morag Hughson
          Oct 24 at 1:46




          Oops, my apologies - typo in command (did from memory). Have corrected answer.
          – Morag Hughson
          Oct 24 at 1:46












          up vote
          -1
          down vote













          You probably need to add another line to your properties.



          Try (from memory so you will need to find the correct constant)
          USE_MQCSP_USERNAME_PASSWORD This should be a boolean and should be set to yes....



          Add this to your properties, then create the queue manager with those properties.






          share|improve this answer





















          • Welcome to SO, it is better to write a answer to something you specifically have knowledge of or have researched than to provide a answer to something you are not certain of (ex: from memory). This is C# he is asking about and while it does have a property similar to what you mentioned, unlike Java it appears to be ignored and if the the USERID and PASSWORD are specified a MQCSP is generated no matter if the MQCSP property is set or not. @Morag already provided the likely answer that MQ by default on the Qmgr after authenticating the ID/PW will use the user the process ran as for OAM checks.
            – JoshMc
            Oct 24 at 21:27

















          up vote
          -1
          down vote













          You probably need to add another line to your properties.



          Try (from memory so you will need to find the correct constant)
          USE_MQCSP_USERNAME_PASSWORD This should be a boolean and should be set to yes....



          Add this to your properties, then create the queue manager with those properties.






          share|improve this answer





















          • Welcome to SO, it is better to write a answer to something you specifically have knowledge of or have researched than to provide a answer to something you are not certain of (ex: from memory). This is C# he is asking about and while it does have a property similar to what you mentioned, unlike Java it appears to be ignored and if the the USERID and PASSWORD are specified a MQCSP is generated no matter if the MQCSP property is set or not. @Morag already provided the likely answer that MQ by default on the Qmgr after authenticating the ID/PW will use the user the process ran as for OAM checks.
            – JoshMc
            Oct 24 at 21:27















          up vote
          -1
          down vote










          up vote
          -1
          down vote









          You probably need to add another line to your properties.



          Try (from memory so you will need to find the correct constant)
          USE_MQCSP_USERNAME_PASSWORD This should be a boolean and should be set to yes....



          Add this to your properties, then create the queue manager with those properties.






          share|improve this answer












          You probably need to add another line to your properties.



          Try (from memory so you will need to find the correct constant)
          USE_MQCSP_USERNAME_PASSWORD This should be a boolean and should be set to yes....



          Add this to your properties, then create the queue manager with those properties.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Oct 24 at 21:00









          user10554473

          1




          1












          • Welcome to SO, it is better to write a answer to something you specifically have knowledge of or have researched than to provide a answer to something you are not certain of (ex: from memory). This is C# he is asking about and while it does have a property similar to what you mentioned, unlike Java it appears to be ignored and if the the USERID and PASSWORD are specified a MQCSP is generated no matter if the MQCSP property is set or not. @Morag already provided the likely answer that MQ by default on the Qmgr after authenticating the ID/PW will use the user the process ran as for OAM checks.
            – JoshMc
            Oct 24 at 21:27




















          • Welcome to SO, it is better to write a answer to something you specifically have knowledge of or have researched than to provide a answer to something you are not certain of (ex: from memory). This is C# he is asking about and while it does have a property similar to what you mentioned, unlike Java it appears to be ignored and if the the USERID and PASSWORD are specified a MQCSP is generated no matter if the MQCSP property is set or not. @Morag already provided the likely answer that MQ by default on the Qmgr after authenticating the ID/PW will use the user the process ran as for OAM checks.
            – JoshMc
            Oct 24 at 21:27


















          Welcome to SO, it is better to write a answer to something you specifically have knowledge of or have researched than to provide a answer to something you are not certain of (ex: from memory). This is C# he is asking about and while it does have a property similar to what you mentioned, unlike Java it appears to be ignored and if the the USERID and PASSWORD are specified a MQCSP is generated no matter if the MQCSP property is set or not. @Morag already provided the likely answer that MQ by default on the Qmgr after authenticating the ID/PW will use the user the process ran as for OAM checks.
          – JoshMc
          Oct 24 at 21:27






          Welcome to SO, it is better to write a answer to something you specifically have knowledge of or have researched than to provide a answer to something you are not certain of (ex: from memory). This is C# he is asking about and while it does have a property similar to what you mentioned, unlike Java it appears to be ignored and if the the USERID and PASSWORD are specified a MQCSP is generated no matter if the MQCSP property is set or not. @Morag already provided the likely answer that MQ by default on the Qmgr after authenticating the ID/PW will use the user the process ran as for OAM checks.
          – JoshMc
          Oct 24 at 21:27




















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52924929%2fstrange-problem-with-authentication-on-ibmmq-it-takes-the-running-user-id%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Academy of Television Arts & Sciences

          L'Équipe

          1995 France bombings