NoSQLBooster 11.1.6 loses explicit SCRAM-SHA-1 mechanism for MongoDB 3.6 connection
In Progress
Environment
- NoSQLBooster: 11.1.6
- MongoDB Server: 3.6
Problem
MongoDB 3.6 does not support SCRAM-SHA-256.
When I import a connection URI with an explicitly specified authentication mechanism:
mongodb://user:password@host:27017/?authSource=admin&authMechanism=SCRAM-SHA-1the Test Connection succeeds.
However, after saving the connection and connecting using the saved connection profile, NoSQLBooster attempts to authenticate using:
SCRAM-SHA-256and MongoDB returns:
{
"name" : "MongoServerError",
"message" : "Unsupported mechanism SCRAM-SHA-256",
"supportedMechanisms" : [
"MONGODB-CR",
"MONGODB-X509",
"SCRAM-SHA-1"
],
...
}Steps to reproduce - Open NoSQLBooster 11.1.6.
- Import a MongoDB URI containing:
authMechanism=SCRAM-SHA-1
- Run Test Connection.
- Connection succeeds.
- Save the connection.
- Connect using the saved connection.
- Authentication fails because SCRAM-SHA-256 is used.
Expected behavior
The saved connection should preserve:
authMechanism=SCRAM-SHA-1or the driver should correctly negotiate SCRAM-SHA-1 with a MongoDB 3.6 server.
Actual behavior
After the connection is saved, NoSQLBooster initiates authentication using SCRAM-SHA-256.
The same problem
We have confirmed that this problem
In other words, on a MongoDB 3.6 server the authMechanism option is unnecessary - simply leave it out and no further change is required.is resolved by removing authMechanism=SCRAM-SHA-1 from the connection URI. NoSQLBooster's Basic (Username/Password) authentication mode supports SCRAM-SHA-256, SCRAM-SHA-1 and MONGODB-CR, and when the mechanism is not explicitly specified, the built-in driver negotiates it with the server automatically. Since MongoDB 3.6 only supports SCRAM-SHA-1 (SCRAM-SHA-256 was introduced in MongoDB 4.0), the driver selects SCRAM-SHA-1, so both Test Connection and the saved connection work normally with:
For your reference, starting with v11.1.4 NoSQLBooster also removes a redundant SCRAM-SHA mechanism automatically from the connection configuration and lets the driver auto-negotiate it, so this option is no longer required in current versions (v11.1.6 is the latest release).
We have confirmed that this problem
In other words, on a MongoDB 3.6 server the authMechanism option is unnecessary - simply leave it out and no further change is required.is resolved by removing authMechanism=SCRAM-SHA-1 from the connection URI. NoSQLBooster's Basic (Username/Password) authentication mode supports SCRAM-SHA-256, SCRAM-SHA-1 and MONGODB-CR, and when the mechanism is not explicitly specified, the built-in driver negotiates it with the server automatically. Since MongoDB 3.6 only supports SCRAM-SHA-1 (SCRAM-SHA-256 was introduced in MongoDB 4.0), the driver selects SCRAM-SHA-1, so both Test Connection and the saved connection work normally with:
For your reference, starting with v11.1.4 NoSQLBooster also removes a redundant SCRAM-SHA mechanism automatically from the connection configuration and lets the driver auto-negotiate it, so this option is no longer required in current versions (v11.1.6 is the latest release).
Replies have been locked on this page!