Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@mongodb-js/eslint-config-devtools": "^0.9.9",
"@mongodb-js/mocha-config-devtools": "^1.0.0",
"@mongodb-js/monorepo-tools": "^1.1.4",
"@mongodb-js/oidc-mock-provider": "^0.8.0",
"@mongodb-js/oidc-mock-provider": "^0.10.2",
"@mongodb-js/prettier-config-devtools": "^1.0.1",
"@mongodb-js/tsconfig-devtools": "^1.0.0",
"@types/chai": "^4.2.21",
Expand Down
4 changes: 4 additions & 0 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,8 @@ export class MongoDBOIDCPluginImpl implements MongoDBOIDCPlugin {
let client!: BaseClient;
let actualRedirectURI!: string;

const nonce = generators.nonce();

try {
await withAbortCheck(signal, async ({ signalCheck, signalPromise }) => {
// We mark the operations that we want to allow to result in a fallback
Expand All @@ -680,6 +682,7 @@ export class MongoDBOIDCPluginImpl implements MongoDBOIDCPlugin {
code_challenge: codeChallenge,
code_challenge_method: 'S256',
state: oidcStateParam,
nonce,
});
validateSecureHTTPUrl(authCodeFlowUrl, 'authCodeFlowUrl');
const { localUrl, onAccessed: onLocalUrlAccessed } =
Expand Down Expand Up @@ -760,6 +763,7 @@ export class MongoDBOIDCPluginImpl implements MongoDBOIDCPlugin {
const tokenSet = await client.callback(actualRedirectURI, params, {
code_verifier: codeVerifier,
state: oidcStateParam,
nonce,
});
this.updateStateWithTokenSet(state, tokenSet);
}
Expand Down
Loading