@@ -40,13 +40,8 @@ mechanisms.
4040Default Authentication Mechanism
4141--------------------------------
4242
43- In MongoDB 3.0, MongoDB changed the default authentication mechanism
44- from ``MONGODB-CR`` to ``SCRAM-SHA-1``. In MongoDB 4.0, support for
45- the deprecated ``MONGODB-CR`` mechanism was removed and ``SCRAM-
46- SHA-256`` support was added.
47-
4843To create a credential that authenticates by using the default
49- authentication mechanism, regardless of server version , create a
44+ authentication mechanism, ``SCRAM-SHA-256`` , create a
5045credential by using the ``createCredential()`` static factory method:
5146
5247.. code-block:: java
@@ -71,33 +66,24 @@ authentication mechanism:
7166
7267 MongoClient mongoClient = MongoClients.create("mongodb://user1:pwd1@host1/?authSource=db1");
7368
74- For challenge and response mechanisms, using the default
75- authentication mechanism is the recommended approach, as it makes
76- upgrading from MongoDB 2.6 to MongoDB 3.0 more simple, even after
77- upgrading the authentication schema. For MongoDB 4.0 users, using the
78- default authentication mechanism is also recommended as the mechanisms are
79- checked and the correct hashing algorithm is used.
69+ For challenge and response mechanisms, we recommend using the default
70+ authentication mechanism. This simplifies upgrades and ensures that the correct hashing
71+ algorithm is used.
8072
8173SCRAM-Based Mechanisms
8274----------------------
8375
84- Salted Challenge-Response Authentication Mechanism (``SCRAM``) has been
85- the default authentication mechanism for MongoDB since 3.0. ``SCRAM`` is
76+ Salted Challenge-Response Authentication Mechanism (``SCRAM``) is
8677based on the `IETF RFC 5802
8778<https://datatracker.ietf.org/doc/html/rfc5802>`__ standard that defines
8879best practices for implementation of challenge-response mechanisms for authenticating
89- users with passwords.
90-
91- MongoDB 3.0 introduced support for ``SCRAM-SHA-1``, which uses the
92- ``SHA-1`` hashing function. MongoDB 4.0 introduced support for ``SCRAM-
93- SHA-256`` which uses the ``SHA-256`` hashing function.
80+ users with passwords. MongoDB supports both ``SCRAM-SHA-1``, which uses the
81+ ``SHA-1`` hashing function, and ``SCRAM-
82+ SHA-256``, which uses the ``SHA-256`` hashing function.
9483
9584SCRAM-SHA-256
9685~~~~~~~~~~~~~
9786
98- Using this mechanism requires MongoDB 4.0 and
99- ``featureCompatibilityVersion`` to be set to 4.0.
100-
10187To explicitly create a credential of type ``SCRAM-SHA-256``, use
10288the ``createScramSha256Credential()`` method:
10389
@@ -147,7 +133,6 @@ To explicitly create a credential of type ``SCRAM-SHA-1``, use the
147133Or, you can use a connection string that explicitly specifies
148134``authMechanism=SCRAM-SHA-1``:
149135
150-
151136.. code-block:: java
152137
153138 MongoClient mongoClient = MongoClients.create("mongodb://user1:pwd1@host1/?authSource=db1&authMechanism=SCRAM-SHA-1");
@@ -157,12 +142,10 @@ MONGODB-CR
157142
158143.. important::
159144
160- Starting in version 4.0, MongoDB removes support for the deprecated
145+ MongoDB no longer supports the deprecated
161146 MongoDB Challenge-Response (``MONGODB-CR``) authentication mechanism.
162-
163147 If your deployment has user credentials stored in a ``MONGODB-CR`` schema,
164- you must upgrade to use a ``SCRAM``-based mechanism before you
165- upgrade to version 4.0.
148+ you must upgrade to a ``SCRAM``-based mechanism.
166149
167150To explicitly create a credential of type ``MONGODB-CR`` use the
168151``createMongCRCredential()`` static factory method:
0 commit comments