Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
fc926ef
Propagate correlationId through error creation helpers
sameerag May 27, 2026
8035e85
Expand correlationId propagation to remaining error throw sites
sameerag May 27, 2026
84688d4
Add PR link to changefile comments
sameerag May 27, 2026
2c218e8
Potential fix for pull request finding
sameerag May 27, 2026
890284a
Potential fix for pull request finding
sameerag May 27, 2026
7229b37
Merge branch 'dev' into correlationId-in-errorpath
sameerag May 27, 2026
6335b96
Update msal-common api review for correlationId param
sameerag May 27, 2026
263c3eb
Make correlationId a required parameter in msal-common error construc…
sameerag May 27, 2026
726b54c
Refactor msal-browser to use mandatory correlationId in errors
sameerag May 27, 2026
840a5c2
msal-node: mandatory correlationId in error constructors
sameerag May 27, 2026
777bfc0
msal-node-extensions: mandatory correlationId in error constructors
sameerag May 27, 2026
575bc89
msal-react: mandatory correlationId in error constructors
sameerag May 27, 2026
75b06b0
msal-angular: mandatory correlationId in error constructors
sameerag May 27, 2026
2203613
Add changefiles for correlationId breaking change; bump types; remove…
sameerag May 27, 2026
098cb6e
Apply prettier formatting to correlationId refactor changes
sameerag May 27, 2026
9299466
Merge branch 'dev' into correlationId-in-errorpath
sameerag May 29, 2026
42d65cf
Test: assert correlationId set on ServerError and JoseHeaderError con…
sameerag May 29, 2026
31b2c0f
Apply prettier formatting
sameerag May 29, 2026
441dc21
Merge branch 'dev' into correlationId-in-errorpath
sameerag Jun 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions change/@azure-msal-angular-correlationid-required-8609.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Pass correlationId to BrowserConfigurationAuthError constructors in MsalGuard and MsalInterceptor to match the updated msal-browser error signature [#8609](https://github.com/AzureAD/microsoft-authentication-library-for-js/pull/8609)",
"packageName": "@azure/msal-angular",
"email": "sameera.gajjarapu@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Make correlationId a required parameter on AuthError and all derived error classes; remove setCorrelationId in favor of direct assignment [#8609](https://github.com/AzureAD/microsoft-authentication-library-for-js/pull/8609)",
"packageName": "@azure/msal-browser",
"email": "sameera.gajjarapu@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Make correlationId a required parameter on AuthError and all derived error classes (ClientAuthError, ClientConfigurationError, ServerError, InteractionRequiredAuthError, NetworkError, PlatformBrokerError); remove setCorrelationId in favor of direct assignment [#8609](https://github.com/AzureAD/microsoft-authentication-library-for-js/pull/8609)",
"packageName": "@azure/msal-common",
"email": "sameera.gajjarapu@microsoft.com",
"dependentChangeType": "patch"
}
7 changes: 7 additions & 0 deletions change/@azure-msal-node-correlationid-required-8609.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Make correlationId a required parameter on NodeAuthError and ManagedIdentityError; update all error throw sites and remove setCorrelationId usages [#8609](https://github.com/AzureAD/microsoft-authentication-library-for-js/pull/8609)",
"packageName": "@azure/msal-node",
"email": "sameera.gajjarapu@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Pass correlationId to PlatformBrokerError, InteractionRequiredAuthError, and ServerError constructors in NativeBrokerPlugin to match the updated msal-common error signatures [#8609](https://github.com/AzureAD/microsoft-authentication-library-for-js/pull/8609)",
"packageName": "@azure/msal-node-extensions",
"email": "sameera.gajjarapu@microsoft.com",
"dependentChangeType": "patch"
}
7 changes: 7 additions & 0 deletions change/@azure-msal-react-correlationid-required-8609.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Make correlationId a required parameter on ReactAuthError to match the updated msal-browser AuthError signature [#8609](https://github.com/AzureAD/microsoft-authentication-library-for-js/pull/8609)",
"packageName": "@azure/msal-react",
"email": "sameera.gajjarapu@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,10 @@ export class NativeBrokerPlugin implements INativeBrokerPlugin {

const account = await this.getAccount(request);
if (!account) {
throw createClientAuthError(ClientAuthErrorCodes.noAccountFound);
throw createClientAuthError(
ClientAuthErrorCodes.noAccountFound,
""
);
}

return new Promise((resolve, reject) => {
Expand Down Expand Up @@ -668,6 +671,7 @@ export class NativeBrokerPlugin implements INativeBrokerPlugin {

const msalNodeRuntimeError = new PlatformBrokerError(
ErrorStatus[errorStatus],
"",
errorContext,
errorCode,
errorTag
Expand All @@ -680,42 +684,49 @@ export class NativeBrokerPlugin implements INativeBrokerPlugin {
case ErrorStatus.AccountUnusable:
wrappedError = new InteractionRequiredAuthError(
ErrorCodes.INTERATION_REQUIRED_ERROR_CODE,
"",
msalNodeRuntimeError.message
);
break;
case ErrorStatus.NoNetwork:
case ErrorStatus.NetworkTemporarilyUnavailable:
wrappedError = createClientAuthError(
ClientAuthErrorCodes.noNetworkConnectivity
ClientAuthErrorCodes.noNetworkConnectivity,
""
);
break;
case ErrorStatus.ServerTemporarilyUnavailable:
wrappedError = new ServerError(
ErrorCodes.SERVER_UNAVAILABLE,
"",
msalNodeRuntimeError.message
);
break;
case ErrorStatus.UserCanceled:
wrappedError = createClientAuthError(
ClientAuthErrorCodes.userCanceled
ClientAuthErrorCodes.userCanceled,
""
);
break;
case ErrorStatus.AuthorityUntrusted:
wrappedError = createClientConfigurationError(
ClientConfigurationErrorCodes.untrustedAuthority
ClientConfigurationErrorCodes.untrustedAuthority,
""
);
break;
case ErrorStatus.UserSwitched:
// Not an error case, if there's customer demand we can surface this as a response property
return null;
case ErrorStatus.AccountNotFound:
wrappedError = createClientAuthError(
ClientAuthErrorCodes.noAccountFound
ClientAuthErrorCodes.noAccountFound,
""
);
break;
default:
wrappedError = createClientAuthError(
ClientAuthErrorCodes.platformBrokerError
ClientAuthErrorCodes.platformBrokerError,
""
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,16 @@ if (process.platform === "win32") {
describe("NativeBrokerPlugin", () => {
const testPlatformBrokerError = new PlatformBrokerError(
ErrorStatus[msalRuntimeExampleError.errorStatus],
"",
msalRuntimeExampleError.errorContext,
msalRuntimeExampleError.errorCode,
msalRuntimeExampleError.errorTag
);

// Expected wrapped error for the default case (Unexpected status)
const testWrappedBrokerError = createClientAuthError(
ClientAuthErrorCodes.platformBrokerError
ClientAuthErrorCodes.platformBrokerError,
""
);
testWrappedBrokerError.platformBrokerError = testPlatformBrokerError;

Expand Down Expand Up @@ -1770,7 +1772,10 @@ if (process.platform === "win32") {
await expect(
nativeBrokerPlugin.signOut(request)
).rejects.toThrowError(
createClientAuthError(ClientAuthErrorCodes.noAccountFound)
createClientAuthError(
ClientAuthErrorCodes.noAccountFound,
""
)
);
});

Expand Down Expand Up @@ -2040,7 +2045,8 @@ if (process.platform === "win32") {
.catch((error) => {
expect(error).toStrictEqual(
createClientAuthError(
ClientAuthErrorCodes.noNetworkConnectivity
ClientAuthErrorCodes.noNetworkConnectivity,
""
)
);
done();
Expand Down Expand Up @@ -2100,7 +2106,8 @@ if (process.platform === "win32") {
.catch((error) => {
expect(error).toStrictEqual(
createClientAuthError(
ClientAuthErrorCodes.noNetworkConnectivity
ClientAuthErrorCodes.noNetworkConnectivity,
""
)
);
done();
Expand Down Expand Up @@ -2215,7 +2222,8 @@ if (process.platform === "win32") {
.catch((error) => {
expect(error).toStrictEqual(
createClientAuthError(
ClientAuthErrorCodes.userCanceled
ClientAuthErrorCodes.userCanceled,
""
)
);
done();
Expand Down Expand Up @@ -2274,7 +2282,8 @@ if (process.platform === "win32") {
.catch((error) => {
expect(error).toStrictEqual(
createClientConfigurationError(
ClientConfigurationErrorCodes.untrustedAuthority
ClientConfigurationErrorCodes.untrustedAuthority,
""
)
);
done();
Expand Down Expand Up @@ -2397,7 +2406,8 @@ if (process.platform === "win32") {
.catch((error) => {
expect(error).toStrictEqual(
createClientAuthError(
ClientAuthErrorCodes.noAccountFound
ClientAuthErrorCodes.noAccountFound,
""
)
);
done();
Expand Down
1 change: 1 addition & 0 deletions lib/msal-angular/src/msal.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export class MsalGuard {
) {
throw new BrowserConfigurationAuthError(
"invalid_interaction_type",
"",
"Invalid interaction type provided to MSAL Guard. InteractionType.Popup or InteractionType.Redirect must be provided in the MsalGuardConfiguration"
);
}
Expand Down
8 changes: 4 additions & 4 deletions lib/msal-angular/src/msal.interceptor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ describe("MsalInterceptor", () => {

msalBroadcastService.inProgress$ = _inProgress.asObservable();

const sampleError = new AuthError("123", "message");
const sampleError = new AuthError("123", "", "message");
const sampleAccessToken = {
accessToken: "123abc",
};
Expand Down Expand Up @@ -549,7 +549,7 @@ describe("MsalInterceptor", () => {

msalBroadcastService.inProgress$ = _inProgress.asObservable();

const sampleError = new AuthError("123", "message");
const sampleError = new AuthError("123", "", "message");

spyOn(
PublicClientApplication.prototype,
Expand Down Expand Up @@ -593,7 +593,7 @@ describe("MsalInterceptor", () => {

msalBroadcastService.inProgress$ = _inProgress.asObservable();

const sampleError = new AuthError("123", "message");
const sampleError = new AuthError("123", "", "message");
const sampleAccessToken = {
accessToken: "123abc",
};
Expand Down Expand Up @@ -656,7 +656,7 @@ describe("MsalInterceptor", () => {

msalBroadcastService.inProgress$ = _inProgress.asObservable();

const sampleError = new AuthError("123", "message");
const sampleError = new AuthError("123", "", "message");
const sampleAccessToken = {
accessToken: "123abc",
};
Expand Down
1 change: 1 addition & 0 deletions lib/msal-angular/src/msal.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export class MsalInterceptor implements HttpInterceptor {
) {
throw new BrowserConfigurationAuthError(
"invalid_interaction_type",
"",
"Invalid interaction type provided to MSAL Interceptor. InteractionType.Popup, InteractionType.Redirect must be provided in the msalInterceptorConfiguration"
);
}
Expand Down
10 changes: 5 additions & 5 deletions lib/msal-angular/src/msal.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ describe("MsalService", () => {
});

it("failure", (done) => {
const sampleError = new AuthError("123", "message");
const sampleError = new AuthError("123", "", "message");

spyOn(PublicClientApplication.prototype, "loginPopup").and.returnValue(
new Promise((resolve, reject) => {
Expand Down Expand Up @@ -174,7 +174,7 @@ describe("MsalService", () => {
});

it("failure", (done) => {
const sampleError = new AuthError("123", "message");
const sampleError = new AuthError("123", "", "message");

spyOn(PublicClientApplication.prototype, "ssoSilent").and.returnValue(
new Promise((resolve, reject) => {
Expand Down Expand Up @@ -232,7 +232,7 @@ describe("MsalService", () => {
});

it("failure", (done) => {
const sampleError = new AuthError("123", "message");
const sampleError = new AuthError("123", "", "message");

spyOn(
PublicClientApplication.prototype,
Expand Down Expand Up @@ -313,7 +313,7 @@ describe("MsalService", () => {
});

it("failure", (done) => {
const sampleError = new AuthError("123", "message");
const sampleError = new AuthError("123", "", "message");

spyOn(
PublicClientApplication.prototype,
Expand Down Expand Up @@ -381,7 +381,7 @@ describe("MsalService", () => {
});

it("failure and also resets inProgress event to none", (done) => {
const sampleError = new AuthError("123", "message");
const sampleError = new AuthError("123", "", "message");

//@ts-ignore
broadcastService._inProgress.next(InteractionStatus.Startup);
Expand Down
Loading
Loading