-
Type: Bug
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
-
None
-
Environment:OS:
node.js / npm versions:
Additional info:
-
1
-
Not Needed
Problem Statement/Rationale
When using mongosh with X.509 credentials, if a user attempts to manually re-authenticate with SCRAM, they get this error:
MongoParseError: [object Object] can only have authSource set to '$external'
This case should error per the auth spec, but the message returned is cryptic, especially due to the "[object Object]" portion.
Steps to Reproduce
Start a mongod server with an X.509 user registered and authentication enabled. After that, these commands should repro the issue:
> mongosh --tlsAllowInvalidHostnames --tls --tlsCAFile <file> --tlsCertificateKeyFile <file> --authenticationMechanism MONGODB-X509 > use admin > db.auth("user", "pwd")
Expected Results
An error occurs and the message clearly explains the issue.
Actual Results
An error occurs but the message is a bit cryptic.
Additional Notes
This message is coming from the Node.js driver here, but I'm not sure if the [object Object] display is due to the driver or the shell.
Also, I wanted to file this as an Improvement but didn't see that category, so I filed as bug instead. Feel free to change if there's a better category.
- depends on
-
NODE-4518 Error message for X.509 without authSource=$external is unhelpful
- Closed
- is related to
-
COMPASS-5801 Improve x509 connection string missing $external error message
- Closed