Skip to content

Commit faf3d9b

Browse files
committed
edits for clarity and add resources
1 parent b477176 commit faf3d9b

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

source/fundamentals/enterprise-auth.txt

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,8 @@ If your application runs on an Azure VM, or otherwise uses the
142142
built-in Azure support.
143143

144144
You can configure OIDC for Azure IMDS by setting the ``mechanism`` field of your
145-
``Credential`` struct to ``AuthMechanism::MongoDBOidc``. Then, specify the
146-
authentication mechanism by seting the following values in the
147-
``mechanism_properties`` field:
145+
``Credential`` struct to ``AuthMechanism::MongoDBOidc``. This example specifies
146+
the authentication mechanism by using the following placeholders:
148147

149148
- ``username``: If you're using an Azure managed identity, set this to the
150149
client ID of the managed identity. If you're using a service principal to
@@ -202,11 +201,12 @@ The {+driver-short+} doesn't offer built-in support for all platforms, including
202201
the AWS Elastic Kubernetes Service (EKS). To use OIDC to authenticate against
203202
unsupported platforms, you must define a custom callback function.
204203

205-
First, define a custom callback for an EKS cluster with a configured Identity
206-
and Access Management (IAM) OIDC provider. Then, read the access token from a
207-
path set in the ``AWS_WEB_IDENTITY_TOKEN_FILE`` environment variable. Finally,
208-
set the ``oidc_callback`` field of your ``Credential`` struct to
209-
``oidc::Callback::machine`` as shown in the following example:
204+
The following code is an example implementation of custom callback for an EKS
205+
cluster. First, set the ``oidc_callback`` field of your ``Credential`` struct to
206+
``oidc::Callback::machine``. Then, read the access token from a path set in the
207+
``AWS_WEB_IDENTITY_TOKEN_FILE`` environment variable. Finally, set the value of
208+
the ``access_token`` field of the ``IdpServerResponse`` struct. Optionally, set
209+
the values of the ``expires`` and ``refresh_token`` fields.
210210

211211
.. literalinclude:: /includes/fundamentals/code-snippets/enterprise-auth.rs
212212
:language: rust
@@ -223,8 +223,8 @@ following process:
223223

224224
1. The driver retrieves the Identity Provider Information (IDPInfo) for the
225225
provided username.
226-
#. The callback negotiates with the IDP to obtain an ``AccessToken``, and any
227-
potential ``RefreshToken`` and timeout values, if configured, then returns
226+
#. The callback negotiates with the IDP to obtain an ``access_token``, and any
227+
potential ``refresh_token`` and timeout values, if configured, then returns
228228
them.
229229

230230
The following example defines a custom callback to handle workforce identity.
@@ -259,3 +259,5 @@ guide, see the following API documentation:
259259
- `ClientOptions <{+api+}/options/struct.ClientOptions.html>`__
260260
- `Client <{+api+}/struct.Client.html>`__
261261
- `with_options() <{+api+}/struct.Client.html#method.with_options>`__
262+
- `CallbackContext <{+api+}/options/oidc/struct.CallbackContext.html>`__
263+
- `IdpServerResponse <{+api+}/options/oidc/struct.IdpServerResponse.html>`__

0 commit comments

Comments
 (0)