On this page本页内容
Note
Starting in version 4.0, MongoDB removes support for the deprecated MongoDB Challenge-Response (从版本4.0开始,MongoDB取消了对不推荐使用的MongoDB质询响应(MONGODB-CR
) authentication mechanism.MongoDB-CR
)身份验证机制的支持。
If your deployment has user credentials stored in 如果部署的用户凭据存储在MONGODB-CR
schema, you must upgrade to SCRAM before you upgrade to version 4.0.MongoDB-CR
架构中,则必须先升级到SCRAM,然后才能升级到版本4.0。For information on upgrading to 有关升级到SCRAM
, see Upgrade to SCRAM.SCRAM
的信息,请参阅升级到SCRAM。
Salted Challenge Response Authentication Mechanism (SCRAM) is the default authentication mechanism for MongoDB.Salted Challenge-Response认证机制(SCRAM)是MongoDB的默认认证机制。SCRAM is based on the IETF RFC 5802 standard that defines best practices for implementation of challenge-response mechanisms for authenticating users with passwords.SCRAM基于IETF RFC 5802标准,该标准定义了用密码验证用户的质询-响应机制实现的最佳实践。
Using SCRAM, MongoDB verifies the supplied user credentials against the user’s 使用SCRAM,MongoDB根据name
, password
and authentication database
.name
、password
和authentication database
验证提供的用户凭据。The authentication database is the database where the user was created, and together with the user’s name, serves to identify the user.身份验证数据库是创建用户的数据库,与用户名一起用于标识用户。
MongoDB’s implementation of SCRAM provides:MongoDB实施SCRAM提供:
MongoDB supports the following SCRAM mechanisms:MongoDB支持以下紧急停堆机制:
SCRAM-SHA-1 |
|
SCRAM-SHA-256 |
|
When creating or updating a SCRAM user, you can indicate the specific SCRAM mechanism as well as indicate whether the server or the client digests the password.创建或更新紧急停堆用户时,您可以指示特定的紧急停堆机制,以及指示服务器或客户端是否消化密码。When using 当使用SCRAM-SHA-256
, MongoDB requires server-side password hashing, i.e. the server digests the password.SCRAM-SHA-256
时,MongoDB需要服务器端密码散列,即服务器对密码进行消化。For details, see 有关详细信息,请参阅db.createUser()
and db.updateUser()
.db.updateUser()
和db.updateUser()
。
To use SCRAM, you must upgrade your driver if your current driver version does not support 要使用SCRAM,如果当前驱动程序版本不支持SCRAM
.SCRAM
,则必须升级驱动程序。
The minimum driver versions that support 支持SCRAM
are:SCRAM
的最低驱动程序版本为:
Driver Language | Version | Driver Language | Version |
---|---|---|---|
C | 1.1.0 | Perl | 1.0.0 |
C++ | 1.0.0 | PHP | 1.0 |
C# | 1.10 | Python | 2.8 |
Java | 2.13 | Motor | 0.4 |
Node.js | 1.4.29 | Ruby | 1.12 |
Scala | 2.8.0 |