1- .. _node-authentication-mechanisms:
2-
31=========================
42Authentication Mechanisms
53=========================
@@ -124,7 +122,7 @@ in the following sample code.
124122 SCRAM </release-notes/3.0-scram/>`, any ``MONGODB-CR`` user
125123 authentication requests fail.
126124
127- .. _mongodb-aws:
125+ .. _mongodb-aws:
128126
129127``MONGODB-AWS``
130128---------------
@@ -144,7 +142,7 @@ user. If you do not already have the `AWS signature library
144142 npm install aws4
145143
146144To connect to a MongoDB instance with ``MONGODB-AWS`` authentication
147- enabled, specify the ``MONGODB-AWS`` authentication mechanism.
145+ enabled, specify the ``MONGODB-AWS`` authentication mechanism.
148146
149147The driver checks for your credentials in the following sources in order:
150148
@@ -163,19 +161,19 @@ The driver checks for your credentials in the following sources in order:
163161 add your ``AWS_ACCESS_KEY_ID`` and ``AWS_SECRET_ACCESS_KEY``
164162 credentials to your environment variables. If your AWS
165163 login requires an ``AWS_SESSION_TOKEN``, add it to your
166- environment variables as well.
164+ environment variables as well.
167165
168166 The following code shows an example of specifying the ``MONGODB-AWS``
169167 authentication mechanism with environment variables:
170168
171169 .. note::
172-
170+
173171 You don't need to specify these credentials in your connection URI
174172 because the driver automatically retrieves them when you attempt
175173 to connect.
176174
177175 .. literalinclude:: /code-snippets/authentication/aws-env-variable.js
178- :language: javascript
176+ :language: javascript
179177
180178 .. tab:: Connection String
181179 :tabid: connection string
@@ -189,13 +187,13 @@ The driver checks for your credentials in the following sources in order:
189187 authentication mechanism and credentials with a connection string:
190188
191189 .. important::
192-
190+
193191 Always **URI encode** the username and certificate file path using the
194192 ``encodeURIComponent`` method to ensure they are correctly parsed.
195193
196194 .. literalinclude:: /code-snippets/authentication/aws.js
197- :language: javascript
198-
195+ :language: javascript
196+
199197``X.509``
200198---------
201199
0 commit comments