Docs Menu

Authentication Mechanisms

On this page

  • Default Authentication Mechanism
  • Specify Authentication Mechanism

Starting in version 4.0, MongoDB removes support for the deprecated MongoDB Challenge-Response (MONGODB-CR) authentication mechanism.

MongoDB supports the following authentication mechanisms:

In addition, MongoDB Enterprise provides integration with a number of external authentication mechanisms, including Kerberos and LDAP. See Enterprise Authentication Mechanisms for the additional authentication mechanisms supported by MongoDB Enterprise.

As of MongoDB 3.0, Salted Challenge Response Authentication Mechanism (SCRAM) is the default authentication mechanism for MongoDB.

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 mongosh and the MongoDB tools, you can also specify the authentication mechanism from the command line.

Give Feedback
© 2021 MongoDB, Inc.


  • Careers
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2021 MongoDB, Inc.