- Security >
- Authentication >
- Authentication Mechanisms
Authentication Mechanisms¶
MongoDB supports the following authentication mechanisms:
- SCRAM (Default authentication mechanism)
- MongoDB Challenge and Response (MONGODB-CR)
- x.509 Certificate Authentication.
In addition, MongoDB Enterprise also provides supports for additional mechanisms. See Enterprise Authentication Mechanisms for additional mechanisms available in MongoDB Enterprise.
Default Authentication Mechanism¶
Changed in version 3.0.
As of MongoDB 3.0, Salted Challenge Response Authentication Mechanism (SCRAM) is the default authentication mechanism for MongoDB.
Previous versions used MONGODB-CR as the default.
Specify Authentication Mechanism¶
To specify the authentication mechanism to use, set the
authenticationMechanisms
parameter for mongod
and
mongos
.
Clients specify the authentication mechanism in the db.auth()
method.
For the mongo
shell and the MongoDB tools, you can also specify the
authentication mechanism from the command line.