@@ -326,6 +326,12 @@ see the corresponding syntax.
326
326
327
327
.. tab:: Connection String
328
328
:tabid: mongodb-azure-imds-connection-string
329
+
330
+ To specify Kubernetes OIDC as the authentication mechanism, set the following
331
+ options in your connection string:
332
+
333
+ - ``authMechanism``: Set to ``MONGODB-OIDC``.
334
+ - ``authMechanismProperties``: Set to ``ENVIRONMENT:k8s``.
329
335
330
336
Replace the ``<percent-encoded audience>`` placeholder in the
331
337
following code with the percent-encoded value of the audience server
@@ -385,6 +391,12 @@ see the corresponding syntax.
385
391
386
392
.. tab:: Connection String
387
393
:tabid: mongodb-gcp-imds-connection-string
394
+
395
+ To specify Kubernetes OIDC as the authentication mechanism, set the following
396
+ options in your connection string:
397
+
398
+ - ``authMechanism``: Set to ``MONGODB-OIDC``.
399
+ - ``authMechanismProperties``: Set to ``ENVIRONMENT:k8s``.
388
400
389
401
Replace the ``<percent-encoded audience>`` placeholder in the
390
402
following code with the percent-encoded value of the audience server
@@ -436,6 +448,12 @@ see the corresponding syntax.
436
448
.. tab:: Connection String
437
449
:tabid: mongodb-kubernetes-connection-string
438
450
451
+ To specify Kubernetes OIDC as the authentication mechanism, set the following
452
+ options in your connection string:
453
+
454
+ - ``authMechanism``: Set to ``MONGODB-OIDC``.
455
+ - ``authMechanismProperties``: Set to ``ENVIRONMENT:k8s``.
456
+
439
457
.. code-block:: java
440
458
441
459
MongoClient mongoClient = MongoClients.create(
@@ -446,6 +464,9 @@ see the corresponding syntax.
446
464
.. tab:: MongoCredential
447
465
:tabid: mongodb-kubernetes-mongo-credential
448
466
467
+ Replace the ``hostname`` and ``port`` with the network address and port
468
+ number of your MongoDB deployment.
469
+
449
470
.. code-block:: java
450
471
451
472
MongoCredential credential = MongoCredential.createOidcCredential()
0 commit comments