Configuring MongoDB
authentication
You can configure the wire listener to use MongoDB authentication.
Procedure
To configure MongoDB
SCRAM-SHA-256 authentication:
-
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.
-
Restart the wire listener.
Adding MongoDB users
Procedure
To add the initial MongoDB
authorized users:
-
Start the wire listener with authentication turned off: Set
authentication.enable=false in the wire listener configuration file.
-
Add users by running the createUser command through any
MongoDB
client.
-
Turn on authentication: Set
authentication.enable=true in
the wire listener configuration file.
-
Restart the wire listener.
Have feedback?
Google Analytics is used to store comments and ratings. To provide a comment or rating for a topic, click Accept All Cookies or Allow All in Cookie Preferences in the footer of this page.