You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Translate MFA token error to UIRequiredException instead of ServiceException, Fixes AB#3090086 (#2538)
When MFA is required, the token error response was previously translated
to a ServiceException instead of a UIRequiredException. With this
update, the token error will be translated to a UIRequiredException when
MFA is required.
Customization of native authentication error descriptions will only
occur when the native authentication interface is being used.
[AB#3090086](https://identitydivision.visualstudio.com/Engineering/_workitems/edit/3090086)
@@ -224,33 +223,7 @@ public static ServiceException getExceptionFromTokenErrorResponse(@NonNull final
224
223
225
224
finalServiceExceptionoutErr;
226
225
227
-
if (isNativeAuthenticationMFAError(errorResponse)) {
228
-
ServiceExceptionapiError = newServiceException(
229
-
errorResponse.getError(),
230
-
errorResponse.getErrorDescription(),
231
-
null);
232
-
233
-
StringdeveloperDescription = "Multi-factor authentication is required, which can't be fulfilled as part of this flow. Please sign out and perform a new sign in operation. Please see exception details for more information.";
if (isNativeAuthenticationMFAException(exception)) {
253
+
customDescription = "Multi-factor authentication is required, which can't be fulfilled as part of this flow. Please sign out and perform a new sign in operation. Please see exception details for more information.";
tokenErrorResponse.setErrorDescription("AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access '7ae46e1'. Trace ID: 01276277-3a30020d900900 Correlation ID: 6209e18a-f89b-4f14-a05e-0371c6757adb Timestamp: 2024-11-14 13:09:18Z");
Assert.assertEquals("Multi-factor authentication is required, which can't be fulfilled as part of this flow. Please sign out and perform a new sign in operation. Please see exception details for more information." + description, result.getMessage());
Assert.assertEquals("User password change is required, which can't be fulfilled as part of this flow.Please reset the password and perform a new sign in operation. Please see exception details for more information." + description, result.getMessage());
0 commit comments