@@ -28,9 +28,15 @@ In the :ref:`connection string <connections-connection-options>`, set
2828:urioption:`authMechanismProperties` as needed:
2929
3030- For Microsoft Azure, set ``authMechanismProperties`` to
31- ``ENVIRONMENT:azure``
31+ ``ENVIRONMENT:azure,TOKEN_RESOURCE:<audience>``. Note:
32+ Omit ``TOKEN_RESOURCE`` if using Microsoft Azure Kubernetes
33+ Service (AKS).
3234- For Google Cloud Platform, set ``authMechanismProperties`` to
33- ``ENVIRONMENT:gcp``
35+ ``ENVIRONMENT:gcp,TOKEN_RESOURCE:<audience>``.
36+
37+ Replace ``<audience>`` with the application or service that the access
38+ token is intended for. For more details, see :ref:`Identity Provider
39+ Fields <oidcidentityproviders-fields>`.
3440
3541For details about connection string options, see
3642:ref:`connection-string-auth-options`.
@@ -45,16 +51,16 @@ Microsoft Azure Instance Metadata Service (IMDS):
4551
4652 ./bin/mongosync \
4753 --logPath /var/log/mongosync \
48- --cluster0 "mongodb://clusterOne01.fancyCorp.com:20020,clusterOne02.fancyCorp.com:20020,clusterOne03.fancyCorp.com:20020/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:azure" \
49- --cluster1 "mongodb://clusterTwo01.fancyCorp.com:20020,clusterTwo02.fancyCorp.com:20020,clusterTwo03.fancyCorp.com:20020/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:azure"
54+ --cluster0 "mongodb://clusterOne01.fancyCorp.com:20020,clusterOne02.fancyCorp.com:20020,clusterOne03.fancyCorp.com:20020/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:azure,TOKEN_RESOURCE:https://www.example.com " \
55+ --cluster1 "mongodb://clusterTwo01.fancyCorp.com:20020,clusterTwo02.fancyCorp.com:20020,clusterTwo03.fancyCorp.com:20020/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:azure,TOKEN_RESOURCE:https://www.example.com "
5056
5157.. _c2c-authentication-azure-managed-identities-example:
5258
53- Connect to MongoDB Clusters Using Microsoft Azure Managed Identities
59+ Connect to MongoDB Clusters Using Microsoft Azure Kubernetes Service
5460~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5561
56- To connect to MongoDB clusters using Microsoft Azure Managed Identities
57- and federated authentication, define these environment variables:
62+ To connect to MongoDB clusters using Microsoft Azure Kubernetes Service,
63+ define these environment variables:
5864
5965.. list-table::
6066 :header-rows: 1
@@ -70,7 +76,8 @@ and federated authentication, define these environment variables:
7076 - Azure application client identifier.
7177
7278 * - ``AZURE_CLIENT_ID``
73- - Azure client identifier.
79+ - Azure client identifier of the managed identity to authenticate
80+ with.
7481
7582 * - ``AZURE_FEDERATED_TOKEN_FILE``
7683 - Azure federated token file path.
@@ -79,7 +86,7 @@ For details about Azure and the variables, see the Microsoft Azure
7986documentation.
8087
8188The following ``mongosync`` example defines the environment variables
82- and connects to MongoDB clusters in Microsoft Azure :
89+ and connects to MongoDB clusters:
8390
8491.. code-block:: shell
8592
@@ -92,6 +99,8 @@ and connects to MongoDB clusters in Microsoft Azure:
9299 --cluster0 "mongodb://clusterOne01.fancyCorp.com:20020,clusterOne02.fancyCorp.com:20020,clusterOne03.fancyCorp.com:20020/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:azure" \
93100 --cluster1 "mongodb://clusterTwo01.fancyCorp.com:20020,clusterTwo02.fancyCorp.com:20020,clusterTwo03.fancyCorp.com:20020/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:azure"
94101
102+ ``TOKEN_RESOURCE`` isn't required for this example.
103+
95104Connect to MongoDB Clusters in Google Cloud Platform
96105~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
97106
@@ -102,8 +111,8 @@ Google Cloud Platform:
102111
103112 ./bin/mongosync \
104113 --logPath /var/log/mongosync \
105- --cluster0 "mongodb://clusterOne01.fancyCorp.com:20020,clusterOne02.fancyCorp.com:20020,clusterOne03.fancyCorp.com:20020/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:gcp" \
106- --cluster1 "mongodb://clusterTwo01.fancyCorp.com:20020,clusterTwo02.fancyCorp.com:20020,clusterTwo03.fancyCorp.com:20020/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:gcp"
114+ --cluster0 "mongodb://clusterOne01.fancyCorp.com:20020,clusterOne02.fancyCorp.com:20020,clusterOne03.fancyCorp.com:20020/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:gcp,TOKEN_RESOURCE:https://www.example.com " \
115+ --cluster1 "mongodb://clusterTwo01.fancyCorp.com:20020,clusterTwo02.fancyCorp.com:20020,clusterTwo03.fancyCorp.com:20020/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:gcp,TOKEN_RESOURCE:https://www.example.com "
107116
108117No environment variables are required for Google Cloud Platform.
109118
0 commit comments