@@ -92,7 +92,7 @@ mechanism:
92
92
93
93
.. code-block:: java
94
94
95
- MongoClient mongoClient = MongoClients.create("<username >@<hostname>:<port>/?authSource=$external&authMechanism=GSSAPI");
95
+ MongoClient mongoClient = MongoClients.create("<db_username >@<hostname>:<port>/?authSource=$external&authMechanism=GSSAPI");
96
96
97
97
.. tab::
98
98
:tabid: MongoCredential
@@ -151,7 +151,7 @@ You might need to specify one or more of the following additional
151
151
152
152
.. code-block:: java
153
153
154
- MongoClient mongoClient = MongoClients.create("<username >@<hostname>:<port>/?authSource=$external&authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:myService");
154
+ MongoClient mongoClient = MongoClients.create("<db_username >@<hostname>:<port>/?authSource=$external&authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:myService");
155
155
156
156
.. tab::
157
157
:tabid: MongoCredential
@@ -277,7 +277,7 @@ mechanism:
277
277
278
278
.. code-block:: java
279
279
280
- MongoClient mongoClient = MongoClients.create("<username >:<password >@<hostname>:<port>/?authSource=$external&authMechanism=PLAIN");
280
+ MongoClient mongoClient = MongoClients.create("<db_username >:<db_password >@<hostname>:<port>/?authSource=$external&authMechanism=PLAIN");
281
281
282
282
.. tab::
283
283
:tabid: MongoCredential
@@ -340,21 +340,21 @@ see the corresponding syntax.
340
340
.. code-block:: java
341
341
342
342
MongoClient mongoClient = MongoClients.create(
343
- "mongodb://<username >@<hostname>:<port>/?" +
343
+ "mongodb://<db_username >@<hostname>:<port>/?" +
344
344
"?authMechanism=MONGODB-OIDC" +
345
345
"&authMechanismProperties=ENVIRONMENT:azure,TOKEN_RESOURCE:<percent-encoded audience>");
346
346
347
347
.. tab:: MongoCredential
348
348
:tabid: mongodb-azure-mongo-credential
349
349
350
- Replace the ``<username >`` placeholder with the client ID or application ID of the
350
+ Replace the ``<db_username >`` placeholder with the client ID or application ID of the
351
351
Azure managed identity or enterprise application. Replace the ``<audience>``
352
352
placeholder with the value of the
353
353
``audience`` server parameter configured on your MongoDB deployment.
354
354
355
355
.. code-block:: java
356
356
357
- MongoCredential credential = MongoCredential.createOidcCredential("<username >")
357
+ MongoCredential credential = MongoCredential.createOidcCredential("<db_username >")
358
358
.withMechanismProperty("ENVIRONMENT", "azure")
359
359
.withMechanismProperty("TOKEN_RESOURCE", "<audience>");
360
360
0 commit comments