Docs Menu
Docs Home
MongoDB Manual
/ /


On this page

  • Features
  • Driver Support
  • Additional Information

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

When a user authenticates themselves, MongoDB uses SCRAM to verify the supplied user credentials against the user's name, password and authentication database.

SCRAM is based on the IETF RFC 5802 standard that defines best practices for the implementation of challenge-response mechanisms for authenticating users with passwords.

MongoDB's implementation of SCRAM provides:

  • A tunable work factor (the iteration count)

  • Per-user random salts

  • Bi-directional authentication between server and client

MongoDB supports the following SCRAM mechanisms:

SCRAM Mechanism

Uses the SHA-1 hashing function.

To modify the iteration count for SCRAM-SHA-1, see scramIterationCount.


Uses the SHA-256 hashing function.

To modify the iteration count for SCRAM-SHA-256, see scramSHA256IterationCount.

When you create or update a SCRAM user, you can indicate:

  • the SCRAM mechanism to use

  • whether the server or the client digests the password

When you use SCRAM-SHA-256, MongoDB requires server-side password hashing, which means that the server digests the password. For more information, see db.createUser() and db.updateUser().

The minimum driver versions that support SCRAM are:

Driver Language


Driver Language


If you use SCRAM-SHA-1:


See also:




Use SCRAM to Authenticate Clients