diff --git a/change/@azure-msal-browser-57c391dc-e3ce-424d-9c05-d8ce12a0fd11.json b/change/@azure-msal-browser-57c391dc-e3ce-424d-9c05-d8ce12a0fd11.json new file mode 100644 index 0000000000..e8e48af171 --- /dev/null +++ b/change/@azure-msal-browser-57c391dc-e3ce-424d-9c05-d8ce12a0fd11.json @@ -0,0 +1,7 @@ +{ + "type": "minor", + "comment": "Rename uxNotAllowed error code to uiNotAllowed [#8608](https://github.com/AzureAD/microsoft-authentication-library-for-js/pull/8608)", + "packageName": "@azure/msal-browser", + "email": "198982749+Copilot@users.noreply.github.com", + "dependentChangeType": "patch" +} \ No newline at end of file diff --git a/change/@azure-msal-common-8f93ce80-7488-4e50-a898-2edc8e5dd1b6.json b/change/@azure-msal-common-8f93ce80-7488-4e50-a898-2edc8e5dd1b6.json new file mode 100644 index 0000000000..1c2da6891b --- /dev/null +++ b/change/@azure-msal-common-8f93ce80-7488-4e50-a898-2edc8e5dd1b6.json @@ -0,0 +1,7 @@ +{ + "type": "minor", + "comment": "Rename uxNotAllowed error code to uiNotAllowed [#8608](https://github.com/AzureAD/microsoft-authentication-library-for-js/pull/8608)", + "packageName": "@azure/msal-common", + "email": "198982749+Copilot@users.noreply.github.com", + "dependentChangeType": "patch" +} \ No newline at end of file diff --git a/docs/errors.md b/docs/errors.md index efb22b4cf3..bff43d8e35 100644 --- a/docs/errors.md +++ b/docs/errors.md @@ -305,11 +305,10 @@ This error occurs when MSAL.js surpasses the allotted storage limit when attempt - Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve. -### `ux_not_allowed` +### `ui_not_allowed` - `canShowUI` flag in Edge was set to false. User interaction required on web page. Please invoke an interactive API to resolve. - ### `interrupted_user` - The user could not be authenticated due to an interrupted state. Please invoke an interactive API to resolve. diff --git a/lib/msal-browser/src/broker/nativeBroker/NativeStatusCodes.ts b/lib/msal-browser/src/broker/nativeBroker/NativeStatusCodes.ts index 7c9601117d..4d90420b36 100644 --- a/lib/msal-browser/src/broker/nativeBroker/NativeStatusCodes.ts +++ b/lib/msal-browser/src/broker/nativeBroker/NativeStatusCodes.ts @@ -11,4 +11,4 @@ export const TRANSIENT_ERROR = "TRANSIENT_ERROR"; export const PERSISTENT_ERROR = "PERSISTENT_ERROR"; export const DISABLED = "DISABLED"; export const ACCOUNT_UNAVAILABLE = "ACCOUNT_UNAVAILABLE"; -export const UX_NOT_ALLOWED = "UX_NOT_ALLOWED"; +export const UI_NOT_ALLOWED = "UI_NOT_ALLOWED"; diff --git a/lib/msal-browser/src/error/NativeAuthError.ts b/lib/msal-browser/src/error/NativeAuthError.ts index bdeab1c52b..382e0d3a75 100644 --- a/lib/msal-browser/src/error/NativeAuthError.ts +++ b/lib/msal-browser/src/error/NativeAuthError.ts @@ -99,9 +99,9 @@ export function createNativeAuthError( return createBrowserAuthError( BrowserAuthErrorCodes.noNetworkConnectivity ); - case NativeStatusCodes.UX_NOT_ALLOWED: + case NativeStatusCodes.UI_NOT_ALLOWED: return createInteractionRequiredAuthError( - InteractionRequiredAuthErrorCodes.uxNotAllowed + InteractionRequiredAuthErrorCodes.uiNotAllowed ); } } diff --git a/lib/msal-browser/test/error/NativeAuthError.spec.ts b/lib/msal-browser/test/error/NativeAuthError.spec.ts index 6613e1628a..e13d902871 100644 --- a/lib/msal-browser/test/error/NativeAuthError.spec.ts +++ b/lib/msal-browser/test/error/NativeAuthError.spec.ts @@ -126,7 +126,7 @@ describe("NativeAuthError Unit Tests", () => { ); }); - it("translates UX_NOT_ALLOWED status into corresponding InteractionRequiredError", () => { + it("translates UI_NOT_ALLOWED status into corresponding InteractionRequiredError", () => { const error = createNativeAuthError( "interaction_required", "interaction is required", @@ -134,12 +134,12 @@ describe("NativeAuthError Unit Tests", () => { error: 1, protocol_error: "testProtocolError", properties: {}, - status: NativeStatusCode.UX_NOT_ALLOWED, + status: NativeStatusCode.UI_NOT_ALLOWED, } ); expect(error).toBeInstanceOf(InteractionRequiredAuthError); expect(error.errorCode).toBe( - InteractionRequiredAuthErrorCodes.uxNotAllowed + InteractionRequiredAuthErrorCodes.uiNotAllowed ); }); diff --git a/lib/msal-common/apiReview/msal-common.api.md b/lib/msal-common/apiReview/msal-common.api.md index 2127664ede..11c1310033 100644 --- a/lib/msal-common/apiReview/msal-common.api.md +++ b/lib/msal-common/apiReview/msal-common.api.md @@ -2682,7 +2682,7 @@ declare namespace InteractionRequiredAuthErrorCodes { noTokensFound, nativeAccountUnavailable, refreshTokenExpired, - uxNotAllowed, + uiNotAllowed, interactionRequired, consentRequired, loginRequired, @@ -4636,6 +4636,9 @@ const tokenRequestEmpty = "token_request_empty"; // @public function toSecondsFromDate(date: Date): number; +// @public +const uiNotAllowed = "ui_not_allowed"; + // Warning: (ae-missing-release-tag) "unexpectedCredentialType" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -4734,9 +4737,6 @@ export { UrlUtils } // @public (undocumented) const userCanceled = "user_canceled"; -// @public -const uxNotAllowed = "ux_not_allowed"; - // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // Warning: (ae-missing-release-tag) "validateAuthorizationResponse" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) diff --git a/lib/msal-common/src/error/InteractionRequiredAuthError.ts b/lib/msal-common/src/error/InteractionRequiredAuthError.ts index 33e6fc2a62..7601279459 100644 --- a/lib/msal-common/src/error/InteractionRequiredAuthError.ts +++ b/lib/msal-common/src/error/InteractionRequiredAuthError.ts @@ -15,7 +15,7 @@ export const InteractionRequiredServerErrorMessage = [ InteractionRequiredAuthErrorCodes.consentRequired, InteractionRequiredAuthErrorCodes.loginRequired, InteractionRequiredAuthErrorCodes.badToken, - InteractionRequiredAuthErrorCodes.uxNotAllowed, + InteractionRequiredAuthErrorCodes.uiNotAllowed, InteractionRequiredAuthErrorCodes.interruptedUser, ]; @@ -26,7 +26,7 @@ export const InteractionRequiredAuthSubErrorMessage = [ "user_password_expired", "consent_required", "bad_token", - "ux_not_allowed", + "ui_not_allowed", "interrupted_user", ]; diff --git a/lib/msal-common/src/error/InteractionRequiredAuthErrorCodes.ts b/lib/msal-common/src/error/InteractionRequiredAuthErrorCodes.ts index f63d5af24c..2bf5c3ae27 100644 --- a/lib/msal-common/src/error/InteractionRequiredAuthErrorCodes.ts +++ b/lib/msal-common/src/error/InteractionRequiredAuthErrorCodes.ts @@ -22,8 +22,7 @@ export const refreshTokenExpired = "refresh_token_expired"; * MSAL-defined error code indicating UI/UX is not allowed (e.g., blocked by policy), requiring alternate interaction. * @public */ -export const uxNotAllowed = "ux_not_allowed"; - +export const uiNotAllowed = "ui_not_allowed"; /** * Server-originated error code indicating interaction is required to complete the request. * @public diff --git a/lib/msal-common/test/error/InteractionRequiredAuthError.spec.ts b/lib/msal-common/test/error/InteractionRequiredAuthError.spec.ts index 37e4901836..acc805e346 100644 --- a/lib/msal-common/test/error/InteractionRequiredAuthError.spec.ts +++ b/lib/msal-common/test/error/InteractionRequiredAuthError.spec.ts @@ -105,7 +105,7 @@ describe("InteractionRequiredAuthError.ts Class Unit Tests", () => { InteractionRequiredAuthErrorCodes.nativeAccountUnavailable, InteractionRequiredAuthErrorCodes.refreshTokenExpired, InteractionRequiredAuthErrorCodes.badToken, - InteractionRequiredAuthErrorCodes.uxNotAllowed, + InteractionRequiredAuthErrorCodes.uiNotAllowed, InteractionRequiredAuthErrorCodes.interruptedUser, ];