SCRAM

On this page本页内容

Salted Challenge Response Authentication Mechanism (SCRAM) is the default authentication mechanism for MongoDB.Salted Challenge-Response身份验证机制(SCRAM)是MongoDB的默认身份验证机制。

When a user authenticates themselves, MongoDB uses SCRAM to verify the supplied user credentials against the user's name, password and authentication database.当用户对自己进行身份验证时,MongoDB使用SCRAM根据用户namepassword身份验证数据库验证提供的用户凭据。

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.SCRAM基于IETF RFC 5802标准,该标准定义了使用密码验证用户的质询响应机制的最佳实践。

Features特征

MongoDB's implementation of SCRAM provides:MongoDB实施紧急停堆提供:

  • A tunable work factor (the iteration count)可调工作因子(迭代计数)
  • Per-user random salts每用户随机盐
  • Bi-directional authentication between server and client服务器和客户端之间的双向身份验证

SCRAM Mechanisms紧急停堆机制

MongoDB supports the following SCRAM mechanisms:MongoDB支持以下紧急停堆机制:

SCRAM Mechanism机制Description描述
SCRAM-SHA-1

Uses the SHA-1 hashing function.使用SHA-1哈希函数。

To modify the iteration count for SCRAM-SHA-1, see scramIterationCount.要修改SCRAM-SHA-1的迭代次数,请参阅scramIterationCount

SCRAM-SHA-256

Uses the SHA-256 hashing function.使用SHA-256哈希函数。

To modify the iteration count for SCRAM-SHA-256, see scramSHA256IterationCount.要修改SCRAM-SHA-256的迭代计数,请参阅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. 当您使用SCRAM-SHA-256时,MongoDB需要服务器端密码散列,这意味着服务器会消化密码。For more information, see db.createUser() and db.updateUser().有关详细信息,请参阅db.createUser()db.updateUser()

Driver Support驱动程序支持

The minimum driver versions that support SCRAM are:支持SCRAM的最低驱动程序版本为:

Driver Language驱动语言

Version

Driver Language驱动语言

Version

C1.1.0PHP1.0
C++1.0.0Python2.8
C#1.10Perl1.0.0
Go1.0.0Ruby1.12
Java2.13Rust1.0.0
Motor0.4Scala2.8.0
Node.js1.4.29Swift1.0.0

Additional Information附加信息

If you use SCRAM-SHA-1:如果使用SCRAM-SHA-1

←  AuthenticationUse SCRAM to Authenticate Clients →