@@ -64,43 +64,36 @@ password to authenticate to a server.
6464
6565MongoDB supports the following SCRAM-based authentication mechanisms:
6666
67- - :ref:`SCRAM-SHA-256 <rust-auth-scramsha256>`: an authentication mechanism that
67+ - :ref:`SCRAM-SHA-256 <rust-auth-scramsha256>`: An authentication mechanism that
6868 uses your database username and password, encrypted with the ``SHA-256``
69- algorithm
70- - :ref:`SCRAM-SHA-1 <rust-auth-scramsha1>`: an authentication mechanism that
69+ algorithm. This is the default authentication mechanism.
70+ - :ref:`SCRAM-SHA-1 <rust-auth-scramsha1>`: An authentication mechanism that
7171 uses your database username and password, encrypted with the ``SHA-1``
72- algorithm
72+ algorithm.
7373
74- .. important:: Default Authentication Mechanism
75-
76- If you do not specify an authentication mechanism, the server
77- attempts to validate credentials by using the default authentication
78- mechanism, a SCRAM-based mechanism that varies depending on the
79- version of the server that you are connecting to.
80-
81- The ``SCRAM-SHA-256`` mechanism is the default authentication
82- mechanism for MongoDB Server versions 4.0 and later.
74+ .. _rust-auth-scramsha256:
8375
84- To use the default authentication mechanism, omit only the
85- ``mechanism`` field when you instantiate your ``Credential`` struct.
86- This example uses the following placeholders:
76+ SCRAM-SHA-256
77+ ~~~~~~~~~~~~~
8778
88- - ``db_username``: Your database username
89- - ``db_password``: Your database password
90- - ``db``: The authentication database associated with the user
79+ Since ``SCRAM-SHA-256`` is the default authentication mechanism,
80+ you can omit the ``mechanism`` field when you instantiate your ``Credential`` struct
81+ to use this mechanism.
9182
92- .. literalinclude:: /includes/fundamentals/code-snippets/auth.rs
93- :language: rust
94- :dedent:
95- :start-after: start-default
96- :end-before: end-default
83+ This example specifies the default authentication mechanism by using
84+ the following placeholders:
9785
98- .. _rust-auth-scramsha256:
86+ - ``db_username``: Your database username
87+ - ``db_password``: Your database password
88+ - ``db``: The authentication database associated with the user
9989
100- SCRAM-SHA-256
101- ~~~~~~~~~~~~~
90+ .. literalinclude:: /includes/fundamentals/code-snippets/auth.rs
91+ :language: rust
92+ :dedent:
93+ :start-after: start-default
94+ :end-before: end-default
10295
103- To specify the ``SCRAM-SHA-256`` authentication mechanism, set the
96+ To explicitly specify the ``SCRAM-SHA-256`` authentication mechanism, set the
10497``mechanism`` field of your ``Credential`` struct to
10598``AuthMechanism::ScramSha256``. This example specifies the
10699authentication mechanism by using the following placeholders:
@@ -160,11 +153,8 @@ feature flag to your ``mongodb`` dependency in your project's
160153.. important::
161154
162155 To use the ``MONGODB-AWS`` authentication mechanism in the
163- {+driver-short+}, your application must meet the following
164- requirements:
165-
166- - You are connected to MongoDB Server version 4.4 or later.
167- - You are using the ``tokio`` asynchronous runtime.
156+ {+driver-short+}, your application must use the ``tokio``
157+ asynchronous runtime.
168158
169159The driver obtains the credentials only from the first source in which
170160they are found. The driver checks for your credentials from the following
0 commit comments