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"?
Best Answer
Basically, I made it with db.updateUser.
On the doc, it says the following:
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
asserver
, and ok. Logged out and logged in with the new password.