-
Notifications
You must be signed in to change notification settings - Fork 148
[iOS SDK] Update E2E tests for Email OTP MFA for EC Implementation #2695
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
[iOS SDK] Update E2E tests for Email OTP MFA for EC Implementation #2695
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the iOS SDK's Email OTP MFA implementation for Enhanced Connect (EC) by changing the API to require explicit authentication method selection rather than allowing automatic defaults. The key changes streamline the MFA flow by removing the separate auth method retrieval step and integrating auth methods directly into the awaiting MFA state.
- Removed
getAuthMethods
functionality and related components as users must now specify auth methods explicitly - Updated MFA request challenge APIs to require
MSALAuthMethod
parameter instead of optional - Modified sign-in delegates to automatically provide auth methods when transitioning to MFA state
Reviewed Changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
MSAL/src/native_auth/public/state_machine/state/MFAStates.swift | Removed getAuthMethods method and made authMethod parameter required in requestChallenge |
MSAL/src/native_auth/public/state_machine/delegate/SignInDelegates.swift | Updated delegate methods to include auth methods parameter |
MSAL/src/native_auth/controllers/sign_in/MSALNativeAuthSignInController.swift | Integrated auth method retrieval into token response handling and updated grant types |
MSAL/test/integration/native_auth/end_to_end/mfa/MSALNativeAuthSignInWithMFAEndToEndTests.swift | Updated tests to use new API pattern and removed obsolete test cases |
Multiple test files | Updated unit tests to reflect API changes and removed tests for deprecated functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
func test_defaultErrorDescription() { | ||
let sut: [MFAGetAuthMethodsError] = [ | ||
let sut: [MFARequestChallengeError] = [ |
Copilot
AI
Aug 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable type annotation was changed from [MFAGetAuthMethodsError]
to [MFARequestChallengeError]
but this appears to be a correction rather than an error, as the test method name and context suggest it should be testing MFARequestChallengeError
. However, verify that this change aligns with the intended test behavior.
Copilot uses AI. Check for mistakes.
// MARK: private methods | ||
|
||
|
||
struct SingInUsernameAndPasswordResult { |
Copilot
AI
Aug 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The struct name has a typo: 'SingInUsernameAndPasswordResult' should be 'SignInUsernameAndPasswordResult'.
Copilot uses AI. Check for mistakes.
Proposed changes
Updated E2E tests for Email OTP MFA for EC Implementation. The test
test_signInUsingPasswordWithMFANoDefaultAuthMethod_completeSuccessfully
was removed as it was incorrect since the user has to specify a method now.Type of change
Risk
Additional information