Skip to content

Commit 9cc48e4

Browse files
committed
Move to OIDC section
1 parent 9eff930 commit 9cc48e4

File tree

1 file changed

+19
-23
lines changed

1 file changed

+19
-23
lines changed

source/security/enterprise-auth.txt

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ Enterprise Edition:
3030
- :ref:`Kerberos (GSSAPI) <gssapi-auth-mechanism>`
3131
- :ref:`LDAP (PLAIN) <plain-auth-mechanism>`
3232
- :ref:`MONGODB-OIDC <mongodb-oidc>`
33-
- :ref:`Kubernetes <java-sync-kubernetes>`
3433

3534
To authenticate using another mechanism, see the
3635
:doc:`Authentication Mechanisms guide </fundamentals/auth>`. For more
@@ -423,6 +422,25 @@ see the corresponding syntax.
423422
.credential(credential)
424423
.build());
425424

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+
426444
Custom Callback
427445
+++++++++++++++
428446

@@ -461,25 +479,3 @@ named ``"access-token.dat"`` in the local file system:
461479
builder.hosts(Arrays.asList(new ServerAddress("<hostname>", <port>))))
462480
.credential(credential)
463481
.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

Comments
 (0)