-
Notifications
You must be signed in to change notification settings - Fork 138
Native auth: Update Email OTP MFA to Match EC Implementation, Fixes AB#3351233 #2380
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 (#2379) 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#2760
# Conflicts: # common
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 MFA flow to align with the latest EC implementation. The key change requires developers to always supply an auth method when calling the challenge endpoint, eliminating the previous pattern of calling challenge without parameters and then using getAuthMethods().
- Removes the intermediate
getAuthMethods()API call flow that was previously used in MFA scenarios - Updates all MFA requestChallenge calls to require an AuthMethod parameter instead of being optional
- Simplifies test scenarios by directly using auth methods returned from the MFA required state
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| NativeAuthPublicClientApplicationKotlinTest.kt | Removes complex multi-step MFA test scenarios and updates remaining tests to use auth methods from MFA result |
| NativeAuthPublicClientApplicationJavaTest.java | Consolidates MFA test scenarios and removes getAuthMethods callback implementation |
| SignInMFATest.kt | Simplifies E2E MFA tests by removing getAuthMethods flow and unused imports |
| SignInStates.kt | Adds authMethods to MFARequired result construction |
| MFAStates.kt | Removes getAuthMethods API and makes authMethod parameter required for requestChallenge |
| SignInResult.kt | Adds authMethods property to MFARequired result class |
| MFAResult.kt | Removes SelectionRequired result and MFAGetAuthMethodsResult interface |
| MFAErrors.kt | Removes MFAGetAuthMethodsError class |
| NativeAuthPublicClientApplication.kt | Adds authMethods to MFARequired result construction |
| CommandParametersAdapter.java | Removes getAuthMethods and default challenge command parameters, renames selected challenge parameters |
| common | Updates submodule reference for MSAL Common changes |
...c/test/java/com/microsoft/identity/nativeauth/NativeAuthPublicClientApplicationKotlinTest.kt
Show resolved
Hide resolved
msal/src/main/java/com/microsoft/identity/nativeauth/statemachine/states/MFAStates.kt
Show resolved
Hide resolved
msal/src/main/java/com/microsoft/identity/nativeauth/statemachine/states/MFAStates.kt
Show resolved
Hide resolved
msal/src/main/java/com/microsoft/identity/nativeauth/statemachine/states/MFAStates.kt
Show resolved
Hide resolved
msal/src/main/java/com/microsoft/identity/nativeauth/statemachine/states/MFAStates.kt
Show resolved
Hide resolved
msal/src/main/java/com/microsoft/identity/nativeauth/statemachine/results/SignInResult.kt
Show resolved
Hide resolved
…33 (#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](https://identitydivision.visualstudio.com/Engineering/_workitems/edit/3351233) MSAL PR: AzureAD/microsoft-authentication-library-for-android#2380 --------- Co-authored-by: Mustafa Mizrak <[email protected]>
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 Common PR: AzureAD/microsoft-authentication-library-common-for-android#2764