From 3c7345d91c446467f5388b9891719209c31e7e43 Mon Sep 17 00:00:00 2001 From: Valentin Kovalenko Date: Tue, 27 May 2025 15:11:29 -0600 Subject: [PATCH] Add a prose test for OIDC reauthentication in a session DRIVERS-3195 --- source/auth/tests/mongodb-oidc.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/source/auth/tests/mongodb-oidc.md b/source/auth/tests/mongodb-oidc.md index e95f45e689..7afa3d9ad9 100644 --- a/source/auth/tests/mongodb-oidc.md +++ b/source/auth/tests/mongodb-oidc.md @@ -232,6 +232,31 @@ source the `secrets-export.sh` file and use the associated env variables in your - Assert there were `SaslStart` commands executed. - Close the client. +#### 4.5 Reauthentication Succeeds when a Session is involved + +- Create an OIDC configured client. +- Set a fail point for `find` commands of the form: + +```javascript +{ + configureFailPoint: "failCommand", + mode: { + times: 1 + }, + data: { + failCommands: [ + "find" + ], + errorCode: 391 // ReauthenticationRequired + } +} +``` + +- Start a new session. +- In the started session perform a `find` operation that succeeds. +- Assert that the callback was called 2 times (once during the connection handshake, and again during reauthentication). +- Close the session and the client. + ## (5) Azure Tests Drivers MUST only run the Azure tests when testing on an Azure VM. See instructions in