Skip to content

DOCSP-43148 - Refactor AWS authentication #258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions source/fundamentals/authentication.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,24 @@ MONGODB-AWS
The ``MONGODB-AWS`` authentication mechanism is available only for
MongoDB deployments on MongoDB Atlas.

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

The following sections contain code examples that use the following placeholders:
To use AWS authentication, first perform the following steps:

- Add the ``MongoDB.Driver.Authentication.AWS`` NuGet package to your project.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- Add the following line of code to your application's bootstrap code to register the
AWS authentication provider:

.. code-block:: csharp

MongoAuthentication.RegisterAwsAuthenticationProvider();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace the code with the following one:
MongoClientSettings.Extensions.AddAWSAuthentication();

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's really weird. I don't know where that line came from.


After you register the AWS authentication provider, you can either specify the AWS IAM
credentials explicitly or instruct the driver to retrieve them automatically from an
external source. The following sections describe both of these methods.

The code examples in these sections use the following placeholders:

- ``<awsKeyId>`` - value of the AWS access key ID
- ``<awsSecretKey>`` - value of the AWS secret access key
Expand Down
7 changes: 6 additions & 1 deletion source/upgrade/v3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,16 @@ Version 3.0 Breaking Changes
- The ``MongoClient`` constructor accepts only one ``Credential`` object instead of an
array.

- To use Amazon Web Services (AWS) authentication, you must add the
``MongoDB.Driver.Authentication.AWS`` package to your project and register the
authentication provider in your application's bootstrap code. To learn more about
using AWS authentication with the {+driver-short+}, see :ref:`csharp-mongodb-aws`.

- If you try to serialize or deserialize a floating-point
``Infinity`` or ``NaN`` value to an integral representation, the driver throws an
``OverflowException``. To learn more about floating-point ``Infinity`` and ``NaN``
values, see
`Double.NaN, <https://learn.microsoft.com/en-us/dotnet/api/system.double.nan?view=net-8.0#system-double-nan>`__
`Double.PositiveInfinity, <https://learn.microsoft.com/en-us/dotnet/api/system.double.positiveinfinity?view=net-8.0#system-double-positiveinfinity>`__
and `Double.NegativeInfinity. <https://learn.microsoft.com/en-us/dotnet/api/system.double.negativeinfinity?view=net-8.0#system-double-negativeinfinity>`__
on MSDN.
on MSDN.
Loading