@@ -170,21 +170,24 @@ If your application runs on a Google Compute Engine VM, or otherwise uses the
170170you can authenticate to MongoDB by using the {+driver-short+}'s built-in GCP
171171support.
172172
173- You can configure the OIDC for GCP IMDS by setting the ``mechanism`` field of your
174- ``Credential`` struct to ``AuthMechanism::MongoDBOidc``. The following example
175- specifies the authentication mechaism by using the following placeholders in the
173+ You can configure OIDC for GCP IMDS by setting the ``mechanism`` field of your
174+ ``Credential`` struct to ``AuthMechanism::MongoDBOidc``. Then, specify the
175+ authentication mechanism by setting the following values in the
176176``mechanism_properties`` field:
177177
178178- ``ENVIRONMENT``: Set this property to ``gcp``.
179179- ``TOKEN_RESOURCE``: Set this property to the value of the audience parameter configured
180180 on your MongoDB deployment.
181181
182+ The following code example shows how to set these options when creating a
183+ ``Client``:
184+
182185.. literalinclude:: /includes/fundamentals/code-snippets/enterprise-auth.rs
183186 :language: rust
184187 :dedent:
185188 :start-after: start-gcp-imds
186189 :end-before: end-gcp-imds
187- :emphasize-lines: 2-3
190+ :emphasize-lines: 2-4
188191
189192.. _rust-mongodb-oidc-custom-callback:
190193
@@ -218,8 +221,7 @@ following process:
2182211. The driver retrieves the Identity Provider Information (IDPInfo) for the
219222 provided username.
2202232. The callback negotiates with the IDP to obtain an ``AccessToken``, possible
221- ``RefreshToken``, and any timeouts. Then, it returns them, similar to the
222- ``OIDCMachineCallbacks``.
224+ ``RefreshToken``, and any timeouts, then returns them.
223225
224226The following example defines a custom callback to handle workforce identity.
225227The callback retrieves the IDPInfo for the provided username and negotiates with
0 commit comments