Skip to content

fix: always send a nonce in the auth request MONGOSH-1905 #195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 19, 2024
Merged

Conversation

nirinchev
Copy link
Contributor

Needs mongodb-js/devtools-shared#489 for tests to pass.

@nirinchev nirinchev requested a review from addaleax November 14, 2024 13:23
@addaleax
Copy link
Contributor

Looks like there's a number of genuine CI failures:

RPError: nonce mismatch, expected L4O6qClQ-BhlXlTI8ahMBGHDtVgxUMkYTk1AxufX078, got: undefined

@addaleax
Copy link
Contributor

(ah, duh, that's probably because of mongodb-js/devtools-shared#489)

@nirinchev
Copy link
Contributor Author

Those errors should be fixed once we update to the new mock oidc provider. The old one ignores the nonce completely, which now fails validation because we're expecting it in the token response.

@addaleax
Copy link
Contributor

@nirinchev Do you want to consider making this an opt-in feature, as mentioned on Slack?

@nirinchev
Copy link
Contributor Author

Yeah, I'll try and investigate how that would look like.

@addaleax
Copy link
Contributor

@nirinchev Fwiw, I think we can really make this an option that's parallel to passIdTokenAsAccessToken; it's another boolean flag that's off by default and is exposed through the mongosh CLI options and in the Compass connection form.

In this case, I could see the case for passing the nonce by default, usually in that case I'd prefer a boolean option that still defaults to false, e.g. something that could be called skipNonceInAuthCodeRequest.

The alternative is to survey identity providers and confirm that all relevant ones support nonces – that the tests here pass means that at least Entra ID and Okta do, which is a great starting point.

@nirinchev nirinchev merged commit a6826fb into main Nov 19, 2024
15 checks passed
@nirinchev nirinchev deleted the ni/nonce branch November 19, 2024 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants