@@ -30,7 +30,6 @@ Enterprise Edition:
30
30
- :ref:`Kerberos (GSSAPI) <gssapi-auth-mechanism>`
31
31
- :ref:`LDAP (PLAIN) <plain-auth-mechanism>`
32
32
- :ref:`MONGODB-OIDC <mongodb-oidc>`
33
- - :ref:`Kubernetes <java-sync-kubernetes>`
34
33
35
34
To authenticate using another mechanism, see the
36
35
:doc:`Authentication Mechanisms guide </fundamentals/auth>`. For more
@@ -423,6 +422,25 @@ see the corresponding syntax.
423
422
.credential(credential)
424
423
.build());
425
424
425
+ Kubernetes
426
+ ++++++++++
427
+
428
+ If your application runs on a Kubernetes cluster, you can authenticate to MongoDB by using
429
+ the {+driver-short+}'s built-in Kubernetes support.
430
+
431
+ To specify Kubernetes OIDC as the authentication mechanism, set the following
432
+ options in your connection string:
433
+
434
+ - ``authMechanism``: Set to ``MONGODB-OIDC``.
435
+ - ``authMechanismProperties``: Set to ``ENVIRONMENT:k8s``.
436
+
437
+ The following code example shows how to set the preceding connection options:
438
+
439
+ .. code-block:: java
440
+
441
+ String uri = "mongodb://<hostname>:<port>/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:k8s";
442
+ MongoClient mongoClient = MongoClients.create(uri)
443
+
426
444
Custom Callback
427
445
+++++++++++++++
428
446
@@ -461,25 +479,3 @@ named ``"access-token.dat"`` in the local file system:
461
479
builder.hosts(Arrays.asList(new ServerAddress("<hostname>", <port>))))
462
480
.credential(credential)
463
481
.build());
464
-
465
- .. _java-sync-kubernetes:
466
-
467
- Kubernetes
468
- ~~~~~~~~~~
469
-
470
- If your application runs on a Kubernetes cluster, you can authenticate to MongoDB by using
471
- the {+driver-short+}'s built-in Kubernetes support.
472
-
473
- To specify Kubernetes OIDC as the authentication mechanism, set the following
474
- options in your connection string:
475
-
476
- - ``authMechanism``: Set to ``MONGODB-OIDC``.
477
- - ``authMechanismProperties``: Set to ``ENVIRONMENT:k8s``.
478
-
479
- The following code example shows how to set the preceding connection options:
480
-
481
- .. code-block:: java
482
-
483
- String uri = "mongodb://<hostname>:<port>/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:k8s";
484
- MongoClient mongoClient = MongoClients.create(uri)
485
-
0 commit comments