Skip to content

Commit 03309a4

Browse files
committed
refining edits
1 parent a5e0082 commit 03309a4

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

source/fundamentals/enterprise-auth.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ following process:
224224
1. The driver retrieves the Identity Provider Information (IDPInfo) for the
225225
provided username.
226226
#. The callback negotiates with the IDP to obtain an ``access_token``, and any
227-
potential ``refresh_token`` and timeout values, if configured, then returns
228-
them.
227+
potential ``refresh_token`` and timeout values, if configured. The callback
228+
returns a ``Result<IdpServerInfo>``.
229229

230230
The following example defines a custom callback to handle workforce identity. To
231231
customize this example for your use case, replace ``<human flow>`` with your own
@@ -263,3 +263,4 @@ guide, see the following API documentation:
263263
- `with_options() <{+api+}/struct.Client.html#method.with_options>`__
264264
- `CallbackContext <{+api+}/options/oidc/struct.CallbackContext.html>`__
265265
- `IdpServerResponse <{+api+}/options/oidc/struct.IdpServerResponse.html>`__
266+
- `IdpServerInfo <{+api+}/options/oidc/struct.IdpServerInfo.html>`__

source/includes/fundamentals/code-snippets/enterprise-auth.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use mongodb::options::oidc::{self, CallbackContext, IdpServerResponse};
1+
use mongodb::options::oidc::{self, Callback, CallbackContext, IdpServerResponse};
22
use mongodb::{
33
bson::doc,
44
bson::Document,
@@ -78,17 +78,17 @@ async fn main() -> mongodb::error::Result<()> {
7878
let client = Client::with_options(client_options)?;
7979

8080
let res = client
81-
.database("test")
82-
.collection::<Document>("test")
83-
.find_one(doc! {})
84-
.await?;
81+
.database("test")
82+
.collection::<Document>("test")
83+
.find_one(doc! {})
84+
.await?;
8585
// end-custom-callback-machine
8686

8787
// start-custom-callback-user
8888
let callback = Callback::human(move |context| {
8989
async move {
90-
"<human flow>"
91-
todo!()
90+
"<human flow>";
91+
todo!("human flow")
9292
}
9393
.boxed()
9494
});
@@ -98,12 +98,12 @@ async fn main() -> mongodb::error::Result<()> {
9898
.build();
9999
client_options.credential = Some(credential);
100100
let client = Client::with_options(client_options)?;
101-
101+
102102
let res = client
103-
.database("test")
104-
.collection::<Document>("test")
105-
.find_one(doc! {})
106-
.await?;
103+
.database("test")
104+
.collection::<Document>("test")
105+
.find_one(doc! {})
106+
.await?;
107107
// end-custom-callback-user
108108

109109
Ok(())

0 commit comments

Comments
 (0)