-
Type: Bug
-
Resolution: Done
-
Priority: Blocker - P1
-
Affects Version/s: None
-
Component/s: MongoDB 3.2
-
Environment:linux x86_64
-
Empty show more show less
Hello
I have a database user with: username == 'user' and password == 'passwordUtfééùù'.
var db = new Db('test', new Server('localhost', 27017));
db.open(function(err, db) {
db.authenticate('user', 'passwordUtfééùù', function(err, result)
);
});
The output is:
{ [MongoError: auth fails] name: 'MongoError', message: 'auth fails', code: 18, ok: 0, errmsg: 'auth fails' }Somewere in the lib code (in 4 places in node_modules/mongodb) you can find md5.update(username + ":mongo:" + password); but if you change it to md5.update(username + ":mongo:" + password, 'utf8'); it will authenticate with success
md5.update doc: https://nodejs.org/api/crypto.html#crypto_hash_update_data_input_encoding
In mongoshell it works with db.auth function.
node mongodb version: "^2.1.4"
nodejs version: v0.12.7
mongodb version: 2.4.6
Thanks