-
Notifications
You must be signed in to change notification settings - Fork 46
Native auth: Email OTP MFA to Match EC Implementation, Fixes AB#3351233 #2764
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
Conversation
…B#3351233 (#2760) This PR updates the SDK to match the latest flow from EC. In this new flow, the developer must always supply an auth Method to the /oauth2/v2.0/challenge endpoint which means once the .mfaRequired error is received from token endpoint, the /oauth2/v2.0/introspect endpoint needs to be called to retrieve the methods which are automatically returned to the external developer. Furthermore, whenever calling the /token endpoint is called with an MFA Email OTP code, the grant type should be mfa_oob Fixes [AB#3351233](https://identitydivision.visualstudio.com/Engineering/_workitems/edit/3351233) MSAL PR: AzureAD/microsoft-authentication-library-for-android#2379 --------- Co-authored-by: Mustafa Mizrak <[email protected]>
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 Native Auth SDK to align with the latest EC implementation flow for Email OTP MFA. The key change involves removing the IntrospectRequired response handling and ensuring that MFA flows automatically call the introspect endpoint to retrieve authentication methods, returning them directly to the developer.
- Removes IntrospectRequired error response handling and related test infrastructure
- Updates MFA flow to automatically call introspect endpoint when MFA is required
- Adds MFA_OOB grant type support for Email OTP submissions
Reviewed Changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| MockApiResponseType.kt | Removes INTROSPECT_REQUIRED enum value |
| NativeAuthResponseHandlerTest.kt | Removes test for IntrospectRequired challenge response |
| NativeAuthRequestProviderTest.kt | Adds test assertions for MFA grant type handling |
| ApiErrorResponseUtil.kt | Removes isIntrospectRequired utility function |
| SignInChallengeApiResult.kt | Removes IntrospectRequired result class |
| SignInChallengeApiResponse.kt | Removes IntrospectRequired response handling logic |
| SignInTokenRequest.kt | Adds MFA grant type parameter and conditional logic |
| NativeAuthRequestProvider.kt | Updates OOB token request creation with MFA grant type |
| NativeAuthConstants.kt | Adds MFA_OOB grant type constant |
| SignInCommandResult.kt | Updates MFARequired result to include auth methods instead of error details |
| MFACommandResult.kt | Removes SelectionRequired result class |
| SignInSubmitCodeCommandParameters.java | Adds isMFAGrantType boolean field |
| MFASelectedDefaultChallengeCommandParameters.java | Removes entire file |
| MFAChallengeAuthMethodCommandParameters.java | Renames and updates class structure |
| GetAuthMethodsCommandParameters.java | Removes entire file |
| PublicApiId.java | Removes unused API ID constants |
| CommandUtilTest.kt | Updates tests for MFA grant type handling |
| NativeAuthControllerTest.kt | Major test refactoring for new MFA flow |
| SignInOAuthStrategyTest.kt | Updates tests and removes IntrospectRequired test |
| CommandUtil.java | Adds MFA grant type handling in utility methods |
| NativeAuthMsalController.kt | Major refactoring of MFA handling logic |
| MFAChallengeCommand.kt | Updates parameter type reference |
| GetAuthMethodsCommand.kt | Removes entire file |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...t/identity/common/java/nativeauth/commands/parameters/SignInSubmitCodeCommandParameters.java
Show resolved
Hide resolved
...tity/common/java/nativeauth/commands/parameters/MFAChallengeAuthMethodCommandParameters.java
Show resolved
Hide resolved
...va/com/microsoft/identity/common/nativeauth/internal/controllers/NativeAuthMsalController.kt
Show resolved
Hide resolved
…B#3351233 (#2380) This PR updates the SDK to match the latest flow from EC. In this new flow, the developer must always supply an auth Method to the /oauth2/v2.0/challenge endpoint which means once the .mfaRequired error is received from token endpoint, the /oauth2/v2.0/introspect endpoint needs to be called to retrieve the methods which are automatically returned to the external developer. Furthermore, whenever calling the /token endpoint is called with an MFA Email OTP code, the grant type should be mfa_oob Fixes [AB#3351233](https://identitydivision.visualstudio.com/Engineering/_workitems/edit/3351233) MSAL Common PR: AzureAD/microsoft-authentication-library-common-for-android#2764
This PR updates the SDK to match the latest flow from EC.
In this new flow, the developer must always supply an auth Method to the /oauth2/v2.0/challenge endpoint which means once the .mfaRequired error is received from token endpoint, the /oauth2/v2.0/introspect endpoint needs to be called to retrieve the methods which are automatically returned to the external developer.
Furthermore, whenever calling the /token endpoint is called with an MFA Email OTP code, the grant type should be mfa_oob
Fixes AB#3351233
MSAL PR: AzureAD/microsoft-authentication-library-for-android#2380