@@ -64,43 +64,36 @@ password to authenticate to a server.
64
64
65
65
MongoDB supports the following SCRAM-based authentication mechanisms:
66
66
67
- - :ref:`SCRAM-SHA-256 <rust-auth-scramsha256>`: an authentication mechanism that
67
+ - :ref:`SCRAM-SHA-256 <rust-auth-scramsha256>`: An authentication mechanism that
68
68
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
71
71
uses your database username and password, encrypted with the ``SHA-1``
72
- algorithm
72
+ algorithm.
73
73
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:
83
75
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
+ ~~~~~~~~~~~~~
87
78
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.
91
82
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:
97
85
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
99
89
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
102
95
103
- To specify the ``SCRAM-SHA-256`` authentication mechanism, set the
96
+ To explicitly specify the ``SCRAM-SHA-256`` authentication mechanism, set the
104
97
``mechanism`` field of your ``Credential`` struct to
105
98
``AuthMechanism::ScramSha256``. This example specifies the
106
99
authentication mechanism by using the following placeholders:
@@ -160,11 +153,8 @@ feature flag to your ``mongodb`` dependency in your project's
160
153
.. important::
161
154
162
155
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.
168
158
169
159
The driver obtains the credentials only from the first source in which
170
160
they are found. The driver checks for your credentials from the following
0 commit comments