Skip to content

Commit f4c0bbd

Browse files
authored
DRIVERS-3195 Add a prose test for OIDC reauthentication when a session is involved (#1805)
1 parent 1c1500a commit f4c0bbd

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

source/auth/tests/mongodb-oidc.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,31 @@ source the `secrets-export.sh` file and use the associated env variables in your
232232
- Assert there were `SaslStart` commands executed.
233233
- Close the client.
234234

235+
#### 4.5 Reauthentication Succeeds when a Session is involved
236+
237+
- Create an OIDC configured client.
238+
- Set a fail point for `find` commands of the form:
239+
240+
```javascript
241+
{
242+
configureFailPoint: "failCommand",
243+
mode: {
244+
times: 1
245+
},
246+
data: {
247+
failCommands: [
248+
"find"
249+
],
250+
errorCode: 391 // ReauthenticationRequired
251+
}
252+
}
253+
```
254+
255+
- Start a new session.
256+
- In the started session perform a `find` operation that succeeds.
257+
- Assert that the callback was called 2 times (once during the connection handshake, and again during reauthentication).
258+
- Close the session and the client.
259+
235260
## (5) Azure Tests
236261

237262
Drivers MUST only run the Azure tests when testing on an Azure VM. See instructions in

0 commit comments

Comments
 (0)