Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-622

Cannot use createUser helper on $external database without password

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 0.9.0
    • Affects Version/s: None
    • Component/s: Shell API
    • None
    • 1
    • Iteration Xylocarpus Granatum
    • Not Needed

      Problem Description

      When creating a user on the $external database user creation fails with the error:
      MongoshInvalidInputError: [COMMON-10001] Missing required property: "pwd"

      However, users on the $external database do not have a password.

      Steps to Reproduce

      Try creating a user for X509 authentication:

      xdb = db.getSiblingDB('$external');
      xdb.createUser(
          {
              user: "CN=Client,OU=Public-Client,O=MongoDB",
              roles: [
                  {role: "root", db: "admin"},
              ]
          }
      );
      

      Expected Results

      The user is created successfully.

      Actual Results

      An error is thrown:
      MongoshInvalidInputError: [COMMON-10001] Missing required property: "pwd"

            Assignee:
            michael.rose@mongodb.com Michael Rose (Inactive)
            Reporter:
            michael.rose@mongodb.com Michael Rose (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: