Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-24550

Error out when db.createUser() is used with wrong syntax

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.5.12
    • Affects Version/s: None
    • Component/s: Security, Shell
    • Labels:
    • Fully Compatible

      mongod 3.2.7 64-bit on Windows 10 x64.

      The `createUser()` command creates users that cannot be authenticated (`SCRAM-SHA-1 authentication failed, storedKey mismatch`)

      > db.createUser({createUser:"test",pwd:"test",roles:["dbAdmin"]})
      Successfully added user: { "createUser" : "test", "roles" : [ "dbAdmin" ] }
      >
      > db.auth("test","test")
      Error: Authentication failed.
      0
      >
      

      The only way to get the users to authenticate is to subsequently change their password:

      > db.createUser({createUser:"test",pwd:"test",roles:["dbAdmin"]})
      Successfully added user: { "createUser" : "test", "roles" : [ "dbAdmin" ] }
      > db.changeUserPassword("test","test")
      >
      > db.auth("test","test")
      1
      >
      

            Assignee:
            ben.shteinfeld@mongodb.com Ben Shteinfeld
            Reporter:
            ben.shteinfeld@mongodb.com Ben Shteinfeld
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: