@@ -79,8 +79,6 @@ using a ``MongoCredential`` object or as part of the connection string. Select t
7979:guilabel:`Connection String` or :guilabel:`MongoCredential` tab to
8080see the corresponding syntax.
8181
82- .. include:: /includes/comma-auth-options.rst
83-
8482.. tabs::
8583
8684 .. tab:: Connection String
@@ -127,8 +125,6 @@ using a ``MongoCredential`` object or as part of the connection string. Select t
127125:guilabel:`Connection String` or :guilabel:`MongoCredential` tab to
128126see the corresponding syntax.
129127
130- .. include:: /includes/comma-auth-options.rst
131-
132128.. tabs::
133129
134130 .. tab:: Connection String
@@ -159,11 +155,51 @@ see the corresponding syntax.
159155 .WithMechanismProperty("TOKEN_RESOURCE", "<audience>");
160156 var client = new MongoClient(mongoClientSettings);
161157
158+ Kubernetes
159+ ~~~~~~~~~~
160+
161+ If your application runs on a Kubernetes cluster, you can authenticate to MongoDB by using
162+ the {+driver-short+}'s built-in Kubernetes support.
163+
164+ You can specify Kubernetes OIDC authentication on a ``MongoClientSettings`` object either by
165+ using a ``MongoCredential`` object or as part of the connection string. Select the
166+ :guilabel:`Connection String` or :guilabel:`MongoCredential` tab to
167+ see the corresponding syntax.
168+
169+ .. tabs::
170+
171+ .. tab:: Connection String
172+ :tabid: oidc-kubernetes-connection-string
173+
174+ The following code example shows how to specify Kubernetes OIDC authentication as
175+ part of the connection string:
176+
177+ .. code-block:: csharp
178+
179+ var connectionString = "mongodb://<hostname>[:<port>]/?authMechanism=MONGODB-OIDC" +
180+ "&authMechanismProperties=ENVIRONMENT:k8s";
181+ var mongoClientSettings = MongoClientSettings.FromConnectionString(connectionString);
182+ var client = new MongoClient(mongoClientSettings);
183+
184+ .. tab:: MongoCredential
185+ :tabid: oidc-kubernetes-mongo-credential
186+
187+ The following code example shows how to specify Kubernetes OIDC authentication by using
188+ a ``MongoCredential`` object:
189+
190+ .. code-block:: csharp
191+
192+ var mongoClientSettings = MongoClientSettings.FromConnectionString(
193+ "mongodb://<hostname>[:<port>]");
194+ mongoClientSettings.Credential = MongoCredential
195+ .CreateOidcCredential("k8s")
196+ var client = new MongoClient(mongoClientSettings);
197+
162198Custom Callback
163199~~~~~~~~~~~~~~~
164200
165201The {+driver-short+} doesn't offer built-in support for all platforms, including
166- Azure Functions and Azure Kubernetes Service (AKS) . Instead, you
202+ Azure Functions. Instead, you
167203must define a custom callback to use OIDC to authenticate from these platforms.
168204
169205First, define a class that implements the ``IOidcCallback`` interface. This interface
0 commit comments