Configuring MongoDB authentication

You can configure the wire listener to use MongoDB authentication.

Procedure

To configure MongoDB SCRAM-SHA-256 authentication:
  1. Set the following parameters in the wire listener configuration file:
    • Enable authentication: Set authentication.enable=true.
    • Specify MongoDB authentication: Set db.authentication=mongodb-scram.
    • Set the MongoDB version: Set mongo.api.version to the version that you want.
    • Optional. Require authetntication even from clients on the localhost: Set the authentication.localhost.bypass.enable=false
    • Optional. Specify the authentication timeout period: Set the listener.authentication.timeout parameter to the number of milliseconds for authentication timeout.
  2. Restart the wire listener.

Adding MongoDB users

Procedure

To add the initial MongoDB authorized users:
  1. Start the wire listener with authentication turned off: Set authentication.enable=false in the wire listener configuration file.
  2. Add users by running the createUser command through any MongoDB client.
  3. Turn on authentication: Set authentication.enable=true in the wire listener configuration file.
  4. Restart the wire listener.