Enterprise demodata_rs [direct: primary] local> db.version()
6.0.11
It started as v4.2 and went through a few upgrades.
This is a 3 node test Rep Set. The user in question was created long ago and, as far as I remember it was working fine, but I haven’t used it in a while. Today I wanted to test something with it but I can’t login, as every time, authentication fails with storedKey mismatch. This password only has letters and numbers and NO special characters. Tbh, I have another user with enough privileges so I can just drop the bad user and re-create it but I wonder if anyone else has seen this before. Any help will be appreciated. Thank you.
This is what the log shows,
{"t":{"$date":"2024-11-01T10:07:53.626-07:00"},"s":"I", "c":"ACCESS", "id":20249, "ctx":"conn25697","msg":"Authentication failed","attr":{"mechanism":"SCRAM-SHA-256","speculative":true,"principalName":"dbabkp","authenticationDatabase":"admin","remote":"127.0.0.1:55914","extraInfo":{},"error":"AuthenticationFailed: SCRAM authentication failed, storedKey mismatch"}}
Things I’ve tried,
I have carefully typed the password many times and I have copy/pasted it, validating it was the right string in the clipboard. I’ve reseted the password in clear text and with passwordPrompt(). I even pasted the same clipboard content for the pwd reset and then for the login, like this,
Enterprise demodata_rs [direct: primary] admin> db.changeUserPassword("dbabkp",passwordPrompt())
Enter password
**********{
ok: 1,
'$clusterTime': {
clusterTime: Timestamp({ t: 1730481257, i: 1 }),
signature: {
hash: Binary(Buffer.from("**", "hex"), 0),
keyId: Long("**")
}
},
operationTime: Timestamp({ t: 1730481257, i: 1 })
}
Enterprise demodata_rs [direct: primary] admin> exit
[eduardo@sandbox01: MongoDB SandBox 1 ~]$ mongosh "mongodb://dbabkp@localhost:27017/?authSource=admin"
Enter password: **********
Current Mongosh Log ID: 67250c7935a2baaae2f57183
Connecting to: mongodb://<credentials>@localhost:27017/?authSource=admin&directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+1.5.4
MongoServerError: Authentication failed.
Here is the user,
Enterprise demodata_rs [direct: primary] admin> db.system.users.find({"user":"dbabkp"})
[
{
_id: 'admin.dbabkp',
user: 'dbabkp',
db: 'admin',
credentials: {
'SCRAM-SHA-1': {
iterationCount: 10000,
salt: '**==',
storedKey: '**=',
serverKey: '**='
},
'SCRAM-SHA-256': {
iterationCount: 15000,
salt: '**==',
storedKey: '**=',
serverKey: '**='
}
},
roles: [
{ role: 'backup', db: 'admin' },
{ role: 'clusterMonitor', db: 'admin' },
{ role: 'read', db: 'admin' }
],
authenticationRestrictions: [ ],
userId: UUID("**")
}
]