@@ -31,10 +31,8 @@ mechanisms.
3131Default Authentication Mechanism
3232--------------------------------
3333
34- In MongoDB 3.0, MongoDB changed the default authentication mechanism
35- from ``MONGODB-CR`` to ``SCRAM-SHA-1``. In MongoDB 4.0, support for
36- the deprecated ``MONGODB-CR`` mechanism was removed and ``SCRAM-SHA-256`` support was
37- added.
34+ The default authentication mechanism for MongoDB 6.0 and later is
35+ ``SCRAM-SHA-256``.
3836
3937To create a credential that authenticates by using the default
4038authentication mechanism, regardless of server version, create a
@@ -57,12 +55,6 @@ authentication mechanism:
5755 :copyable:
5856 :dedent:
5957
60- For challenge and response mechanisms, we recommend using the default
61- authentication mechanism. This approach simplifies upgrading from MongoDB 2.6 to MongoDB
62- 3.0, even after upgrading the authentication schema. For MongoDB 4.0 users, we also recommend
63- the default authentication mechanism because it checks the mechanisms and uses the correct
64- hashing algorithm.
65-
6658SCRAM-Based Mechanisms
6759----------------------
6860
@@ -73,15 +65,11 @@ based on the `IETF RFC 5802
7365best practices for implementation of challenge-response mechanisms for authenticating
7466users with passwords.
7567
76- MongoDB 3.0 introduced support for ``SCRAM-SHA-1``, which uses the
77- ``SHA-1`` hashing function. MongoDB 4.0 introduced support for ``SCRAM-SHA-256`` which
78- uses the ``SHA-256`` hashing function.
79-
8068SCRAM-SHA-256
8169~~~~~~~~~~~~~
8270
83- Using this mechanism requires MongoDB 4.0 and
84- ``featureCompatibilityVersion`` to be set to 4.0 .
71+ Using this mechanism requires ``featureCompatibilityVersion`` to be set to 4.0
72+ or a later version .
8573
8674To explicitly create a credential of type ``SCRAM-SHA-256``, use
8775the ``createScramSha256Credential()`` method:
@@ -103,29 +91,6 @@ Or, you can use a connection string that explicitly specifies
10391 :copyable:
10492 :dedent:
10593
106- SCRAM-SHA-1
107- ~~~~~~~~~~~
108-
109- To explicitly create a credential of type ``SCRAM-SHA-1``, use the
110- ``createScramSha1Credential()`` method:
111-
112- .. literalinclude:: /includes/security/auth.scala
113- :start-after: start-scram-sha-1
114- :end-before: end-scram-sha-1
115- :language: scala
116- :copyable:
117- :dedent:
118-
119- Or, you can use a connection string that explicitly specifies
120- ``authMechanism=SCRAM-SHA-1``:
121-
122- .. literalinclude:: /includes/security/auth.scala
123- :start-after: start-scram-sha-1-connection-string
124- :end-before: end-scram-sha-1-connection-string
125- :language: scala
126- :copyable:
127- :dedent:
128-
12994x.509
13095-----
13196
0 commit comments