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

db.auth() helper errors when using X.509 authentication

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.1.4
    • Affects Version/s: None
    • Component/s: Shell API
    • None
    • Not Needed
    • Iteration Phnom Penh

      Problem Statement/Rationale

      Attempting to follow the "Authenticate after Connection" instructions in step 3 of the X.509 docs results in an error:

      > db.getSiblingDB("$external").auth({mechanism: "MONGODB-X509"})
      MongoshInvalidInputError: [COMMON-10001] auth expects user document with 'user' and 'pwd' fields
      

      Steps to Reproduce

      Follow the instructions in the docs linked above and choose the "Authenticate after Connection" option rather than "Connect with Authentication".

      Expected Results

      Authentication succeeds.

      Actual Results

      Authentication fails with the error shown above.

      Additional Notes

            Assignee:
            anna.henningsen@mongodb.com Anna Henningsen
            Reporter:
            divjot.arora@mongodb.com Divjot Arora (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: