You can configure the wire listener to use MongoDB authentication.
Before you begin
If you are upgrading your MongoDB version
and you have existing MongoDB users, you
must upgrade your user schema.
Procedure
To configure MongoDB
authentication:
- Set the following parameters in the wire listener configuration file:
- Enable authentication: Set authentication.enable=true.
- Specify MongoDB authentication: Set
db.authentication=mongodb-cr.
- Set the MongoDB version: Set
mongo.api.version to the version that you want.
- Optional. Specify the authentication timeout period: Set the
listener.authentication.timeout parameter to the number of milliseconds for
authentication timeout.
- Restart the wire listener.
- If necessary, upgrade your user schema by running the authSchemaUpgrade
command in the admin database. For
example:
use admin
db.runCommand({authSchemUpgrade : 1})
The authSchemaUpgrade command upgrades the user schema to the MongoDB version that is specified by the
mongo.api.version parameter.