0

I'm trying to update a password from a user, using changeUserPassword(), and I just receive the following message:

Error: Updating user failed: Use of SCRAM-SHA-256 requires undigested passwords

> db
mydb
> db.getUsers()
[
    {
        "_id"  : "mydb.mongo",
        "user" : "mongo",
        "db"   : "mydb",
        "roles" : [
            {
            "role" : "dbOwner",
            "db" : "mydb"
            }
        ],
        "mechanisms" : [
            "SCRAM-SHA-1",
            "SCRAM-SHA-256"
        ]
    }
]


 > db.changeUserPassword("mongo", "mongo_n3w_p4ss");
2019-05-22T20:58:10.128-0500 E QUERY    [thread1] Error: Updating user failed: Use of SCRAM-SHA-256 requires undigested passwords :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
DB.prototype.updateUser@src/mongo/shell/db.js:1487:15
DB.prototype.changeUserPassword@src/mongo/shell/db.js:1491:9
@(shell):1:1
> db.version()
4.0.5

I also tried updateUser(), but no use.

What am I missing and what is the meaning of "requiring undigested password"?

  • What does version() report in the mongo shell? This should ideally match your server version or at least the release series (4.0.x). – Stennie May 23 at 12:09
1

Basically, I made it with db.updateUser.

On the doc, it says the following:

  • passwordDigestor : string

Optional. Indicates whether the server or the client digests the password.

Available values are:

"server" (Default) The server receives undigested password from the client and digests the password.

"client" (Not compatible with SCRAM-SHA-256) The client digests the password and passes the digested password to the server.

Changed in version 4.0: The default value is "server". In earlier versions, the default value is "client".

It seems that, the default was "client", by unknown reasons. By the way, my Mongo Shell Client is v3.6.3.

Therefore, I just defined passwordDigestor as server, and ok. Logged out and logged in with the new password.

> db.updateUser("mongo", {pwd:"mongo_n3w_p4ss", passwordDigestor:"server"});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.