Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2480 +/- ##
==========================================
- Coverage 91.20% 90.97% -0.24%
==========================================
Files 39 40 +1
Lines 4698 4909 +211
Branches 981 1018 +37
==========================================
+ Hits 4285 4466 +181
- Misses 407 437 +30
Partials 6 6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
dd53018 to
248eca7
Compare
| // Handle MFA required error - return 403 with MFA context | ||
| // Note: session.mfa was already mutated by getTokenSet() before the error was thrown. | ||
| // JavaScript is single-threaded, so no race condition exists. | ||
| if (e instanceof MfaRequiredError) { |
Contributor
There was a problem hiding this comment.
Currently in which all different flows/scenarios are we throwing MfaRequiredError, we should also update the PR description with this information ?
Contributor
Author
There was a problem hiding this comment.
Scenarios:
- Token refresh with MFA token (normal flow)
- Token refresh without MFA token (edge case). If this happens, it will be handled and MfaRequiredError will be thrown with empty mfa token
gyaneshgouraw-okta
previously approved these changes
Jan 12, 2026
Open
mfa_required error)
mfa_required error)
gyaneshgouraw-okta
approved these changes
Jan 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
This PR is the 1st PR in a PR stack
This PR adds support for handling
mfa_requirederror natively and getting access tomfa_tokenandmfa_requirementswhen MFA step-up authentication is required.These parameters can be used to call MFA API methods for challenge and verify operations, which will be added in a later PR.
Changes
MfaRequiredErrorand other MFA related errors.Usage
When accessing a protected resource, catch the
MfaRequiredError. It automatically packages the encryptedmfa_tokenyou need.Testing
Flow tests:
Unit tests for util methods.