-
Notifications
You must be signed in to change notification settings - Fork 46
Native auth: SMS OTP MFA/JIT implementation, Fixes AB#3313635 #2766
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
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 implements SMS OTP Multi-Factor Authentication (MFA) and Just-In-Time (JIT) provisioning capabilities in the native authentication system. The changes extend the existing email OTP infrastructure to support SMS-based verification flows.
- Adds SMS channel support for OTP verification in MFA and JIT flows
- Refactors MFA command structure to use auth method IDs instead of default challenges
- Introduces blocked verification contact handling for improved error messaging
Reviewed Changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| MockApiResponseType.kt | Adds SMS success response type for testing |
| NativeAuthResponseHandlerTest.kt | Removes deprecated introspect required test case |
| NativeAuthRequestProviderTest.kt | Updates OOB token request tests with MFA grant type support |
| ApiErrorResponseUtil.kt | Adds blocked challenge target error detection, removes introspect required check |
| SignInChallengeApiResult.kt | Removes deprecated IntrospectRequired result type |
| SignInChallengeApiResponse.kt | Simplifies response handling by removing introspect required logic |
| AuthenticationMethodApiResult.kt | Makes loginHint field nullable |
| JITChallengeApiResult.kt | Adds BlockedVerificationContact error result |
| JITChallengeApiResponse.kt | Adds blocked verification contact error handling |
| SignInTokenRequest.kt | Adds MFA grant type parameter support |
| NativeAuthRequestProvider.kt | Updates OOB token request creation with MFA grant type |
| NativeAuthConstants.kt | Adds MFA_OOB grant type, removes VOICE channel |
| SignInCommandResult.kt | Refactors MFARequired to include auth methods instead of error details |
| MFACommandResult.kt | Removes SelectionRequired result type |
| JITCommandResult.kt | Adds BlockedVerificationContact result |
| SignInSubmitCodeCommandParameters.java | Adds isMFAGrantType field |
| MFAChallengeAuthMethodCommandParameters.java | Replaces default challenge with auth method ID approach |
| PublicApiId.java | Removes unused MFA API identifiers |
| CommandUtilTest.kt | Updates tests for MFA grant type handling |
| NativeAuthControllerTest.kt | Comprehensive test updates for SMS MFA flows |
| SignInOAuthStrategyTest.kt | Updates token request tests with MFA grant type |
| CommandUtil.java | Adds MFA grant type support to utility methods |
| NativeAuthMsalController.kt | Major refactoring of MFA flow handling and introspect integration |
| MFAChallengeCommand.kt | Updates command to use auth method parameters |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...m/microsoft/identity/common/java/nativeauth/providers/responses/jit/JITChallengeApiResult.kt
Show resolved
Hide resolved
...va/com/microsoft/identity/common/nativeauth/internal/controllers/NativeAuthControllerTest.kt
Outdated
Show resolved
Hide resolved
...va/com/microsoft/identity/common/nativeauth/internal/controllers/NativeAuthMsalController.kt
Show resolved
Hide resolved
# Conflicts: # common/src/test/java/com/microsoft/identity/common/nativeauth/internal/controllers/NativeAuthControllerTest.kt # common4j/src/main/com/microsoft/identity/common/java/nativeauth/controllers/results/SignInCommandResult.kt
This PR needs to be merged after the email OTP MFA one. This PR contains the changes to support SMS OTP MFA/JIT. Verification contact is now a mandatory field. MSAL Common PR: AzureAD/microsoft-authentication-library-common-for-android#2766 Fixes [AB#3313635](https://identitydivision.visualstudio.com/Engineering/_workitems/edit/3313635)
This PR needs to be merged after the email OTP MFA one.
This PR contains the changes to support SMS OTP MFA/JIT.
Verification contact is now a mandatory field.
MSAL PR: AzureAD/microsoft-authentication-library-for-android#2382
Fixes AB#3313635