Skip to content

Commit 1d75584

Browse files
DOCSP-43148 - Refactor AWS authentication (#258)
Co-authored-by: Jordan Smith <[email protected]>
1 parent 56fed94 commit 1d75584

File tree

2 files changed

+25
-6
lines changed

2 files changed

+25
-6
lines changed

source/fundamentals/authentication.txt

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,26 @@ MONGODB-AWS
153153
The ``MONGODB-AWS`` authentication mechanism is available only for
154154
MongoDB deployments on MongoDB Atlas.
155155

156-
The ``MONGODB-AWS`` authentication mechanism uses your Amazon Web Services
157-
Identity and Access Management (AWS IAM) credentials to authenticate your
158-
user. You can either specify your credentials explicitly
159-
or instruct the driver to retrieve them automatically from an external source.
156+
The ``MONGODB-AWS`` authentication mechanism uses Amazon Web Services
157+
Identity and Access Management (AWS IAM) credentials to authenticate a user to MongoDB.
160158

161-
The following sections contain code examples that use the following placeholders:
159+
To use AWS authentication, first perform the following steps:
160+
161+
- Add the `MongoDB.Driver.Authentication.AWS <https://www.nuget.org/packages/MongoDB.Driver.Authentication.AWS>`__
162+
NuGet package to your project.
163+
- Add the following line of code to your application's bootstrap code to register the
164+
AWS authentication provider:
165+
166+
.. code-block:: csharp
167+
:copyable: true
168+
169+
MongoClientSettings.Extensions.AddAWSAuthentication();
170+
171+
After you register the AWS authentication provider, you can either specify the AWS IAM
172+
credentials explicitly or instruct the driver to retrieve them automatically from an
173+
external source. The following sections describe both of these methods.
174+
175+
The code examples in these sections use the following placeholders:
162176

163177
- ``<awsKeyId>`` - value of the AWS access key ID
164178
- ``<awsSecretKey>`` - value of the AWS secret access key

source/upgrade/v3.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,16 @@ Version 3.0 Breaking Changes
150150
- The ``MongoClient`` constructor accepts only one ``Credential`` object instead of an
151151
array.
152152

153+
- To use Amazon Web Services (AWS) authentication, you must add the
154+
``MongoDB.Driver.Authentication.AWS`` package to your project and register the
155+
authentication provider in your application's bootstrap code. To learn more about
156+
using AWS authentication with the {+driver-short+}, see :ref:`csharp-mongodb-aws`.
157+
153158
- If you try to serialize or deserialize a floating-point
154159
``Infinity`` or ``NaN`` value to an integral representation, the driver throws an
155160
``OverflowException``. To learn more about floating-point ``Infinity`` and ``NaN``
156161
values, see
157162
`Double.NaN, <https://learn.microsoft.com/en-us/dotnet/api/system.double.nan?view=net-8.0#system-double-nan>`__
158163
`Double.PositiveInfinity, <https://learn.microsoft.com/en-us/dotnet/api/system.double.positiveinfinity?view=net-8.0#system-double-positiveinfinity>`__
159164
and `Double.NegativeInfinity. <https://learn.microsoft.com/en-us/dotnet/api/system.double.negativeinfinity?view=net-8.0#system-double-negativeinfinity>`__
160-
on MSDN.
165+
on MSDN.

0 commit comments

Comments
 (0)