MCPcopy
hub / github.com/mongodb/node-mongodb-native / auth

Method auth

src/cmap/auth/mongodb_oidc.ts:149–160  ·  view source on GitHub ↗

* Authenticate using OIDC

(authContext: AuthContext)

Source from the content-addressed store, hash-verified

147 * Authenticate using OIDC
148 */
149 override async auth(authContext: AuthContext): Promise<void> {
150 const { connection, reauthenticating, response } = authContext;
151 if (response?.speculativeAuthenticate?.done && !reauthenticating) {
152 return;
153 }
154 const credentials = getCredentials(authContext);
155 if (reauthenticating) {
156 await this.workflow.reauthenticate(connection, credentials);
157 } else {
158 await this.workflow.execute(connection, credentials, response);
159 }
160 }
161
162 /**
163 * Add the speculative auth for the initial handshake.

Callers

nothing calls this directly

Calls 3

getCredentialsFunction · 0.85
reauthenticateMethod · 0.65
executeMethod · 0.65

Tested by

no test coverage detected