Skip to content

Commit 5d384b8

Browse files
committed
Merge branch 'v5-doc-updates' of https://github.com/AzureAD/microsoft-authentication-library-for-js into v5-doc-updates
2 parents 8628134 + 3ad8f11 commit 5d384b8

File tree

65 files changed

+2246
-2592
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+2246
-2592
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Refactor BaseClient usage #8119",
4+
"packageName": "@azure/msal-browser",
5+
"email": "thomas.norling@microsoft.com",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "minor",
3+
"comment": "Refactor BaseClient into Token Protocol #8119",
4+
"packageName": "@azure/msal-common",
5+
"email": "thomas.norling@microsoft.com",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "major",
3+
"comment": "Re-wrote HttpClient to use NodeJS's native fetch API (#8137)",
4+
"packageName": "@azure/msal-node",
5+
"email": "rginsburg@microsoft.com",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Fixed Minor Type Error in BaseManagedIdentitySource.ts (#8114)",
4+
"packageName": "@azure/msal-node",
5+
"email": "rginsburg@microsoft.com",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "major",
3+
"comment": "Remove internal classes from public exports #8119",
4+
"packageName": "@azure/msal-node",
5+
"email": "thomas.norling@microsoft.com",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Improved Managed Identity JSDocs (#8115)",
4+
"packageName": "@azure/msal-node",
5+
"email": "rginsburg@microsoft.com",
6+
"dependentChangeType": "patch"
7+
}

lib/msal-browser/docs/events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ You can consult the [EventPayload](https://azuread.github.io/microsoft-authentic
1818

1919
## How events are emitted in MSAL Browser
2020

21-
Msal browser has a protected function `emitEvent`, and emits events in major APIs. For the list of currently emitted events, see the table below.
21+
Msal Browser has a protected function `emitEvent`, and emits events in major APIs. For the list of currently emitted events, see the table below.
2222

2323
Here is an example of how MSAL Browser emits an event with a payload, or with an error:
2424

lib/msal-browser/src/interaction_handler/InteractionHandler.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,6 @@ export class InteractionHandler {
107107
// Assign code to request
108108
this.authCodeRequest.code = authCodeResponse.code;
109109

110-
// Check for new cloud instance
111-
if (authCodeResponse.cloud_instance_host_name) {
112-
await invokeAsync(
113-
this.authModule.updateAuthority.bind(this.authModule),
114-
BrowserPerformanceEvents.UpdateTokenEndpointAuthority,
115-
this.logger,
116-
this.performanceClient,
117-
request.correlationId
118-
)(authCodeResponse.cloud_instance_host_name, request.correlationId);
119-
}
120-
121110
// Nonce validation not needed when redirect not involved (e.g. hybrid spa, renewing token via rt)
122111
if (validateNonce) {
123112
// TODO: Assigning "response nonce" to "request nonce" is confusing. Refactor the function doing validation to accept request nonce directly

lib/msal-browser/src/telemetry/BrowserPerformanceEvents.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ export const HandleCodeResponse = "handleCodeResponse";
139139
export const HandleResponseEar = "handleResponseEar";
140140
export const HandleResponsePlatformBroker = "handleResponsePlatformBroker";
141141
export const HandleResponseCode = "handleResponseCode";
142-
export const UpdateTokenEndpointAuthority = "updateTokenEndpointAuthority";
143142

144143
export const AuthClientAcquireToken = "authClientAcquireToken";
145144

lib/msal-browser/test/interaction_handler/InteractionHandler.spec.ts

Lines changed: 1 addition & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
CcsCredential,
2424
CcsCredentialType,
2525
StubPerformanceClient,
26+
AuthorityFactory,
2627
} from "@azure/msal-common/browser";
2728
import {
2829
Configuration,
@@ -330,87 +331,6 @@ describe("InteractionHandler.ts Unit Tests", () => {
330331
});
331332

332333
describe("handleCodeResponse()", () => {
333-
// TODO: Need to improve these tests
334-
it("successfully uses a new authority if cloud_instance_host_name is different", async () => {
335-
const idTokenClaims = {
336-
ver: "2.0",
337-
iss: `${TEST_URIS.DEFAULT_INSTANCE}9188040d-6c67-4c5b-b112-36a304b66dad/v2.0`,
338-
sub: "AAAAAAAAAAAAAAAAAAAAAIkzqFVrSaSaFHy782bbtaQ",
339-
exp: "1536361411",
340-
name: "Abe Lincoln",
341-
preferred_username: "AbeLi@microsoft.com",
342-
oid: "00000000-0000-0000-66f3-3332eca7ea81",
343-
tid: "3338040d-6c67-4c5b-b112-36a304b66dad",
344-
nonce: "123523",
345-
login_hint: "testLoginHint",
346-
};
347-
const testCodeResponse: AuthorizationCodePayload = {
348-
code: "authcode",
349-
nonce: idTokenClaims.nonce,
350-
state: TEST_STATE_VALUES.TEST_STATE_REDIRECT,
351-
cloud_instance_host_name: "login.windows.net",
352-
};
353-
const testAccount: AccountInfo = {
354-
homeAccountId: TEST_DATA_CLIENT_INFO.TEST_HOME_ACCOUNT_ID,
355-
environment: "login.windows.net",
356-
tenantId: idTokenClaims.tid,
357-
username: idTokenClaims.preferred_username,
358-
localAccountId: TEST_DATA_CLIENT_INFO.TEST_LOCAL_ACCOUNT_ID,
359-
loginHint: idTokenClaims.login_hint,
360-
};
361-
const testTokenResponse: AuthenticationResult = {
362-
authority: authorityInstance.canonicalAuthority,
363-
accessToken: TEST_TOKENS.ACCESS_TOKEN,
364-
idToken: TEST_TOKENS.IDTOKEN_V2,
365-
fromCache: false,
366-
scopes: ["scope1", "scope2"],
367-
account: testAccount,
368-
correlationId: RANDOM_TEST_GUID,
369-
expiresOn: TestTimeUtils.nowDateWithOffset(
370-
TEST_TOKEN_LIFETIMES.DEFAULT_EXPIRES_IN
371-
),
372-
idTokenClaims: idTokenClaims,
373-
tenantId: idTokenClaims.tid,
374-
uniqueId: idTokenClaims.oid,
375-
state: "testState",
376-
tokenType: Constants.AuthenticationScheme.BEARER,
377-
};
378-
const updateAuthoritySpy = jest.spyOn(
379-
AuthorizationCodeClient.prototype,
380-
"updateAuthority"
381-
);
382-
const acquireTokenSpy = jest
383-
.spyOn(AuthorizationCodeClient.prototype, "acquireToken")
384-
.mockResolvedValue(testTokenResponse);
385-
const interactionHandler = new TestInteractionHandler(
386-
authCodeModule,
387-
browserStorage
388-
);
389-
await interactionHandler.initiateAuthRequest("testNavUrl");
390-
const tokenResponse = await interactionHandler.handleCodeResponse(
391-
testCodeResponse,
392-
{
393-
authority: TEST_CONFIG.validAuthority,
394-
scopes: ["User.Read"],
395-
correlationId: TEST_CONFIG.CORRELATION_ID,
396-
redirectUri: "/",
397-
responseMode: "fragment",
398-
nonce: TEST_CONFIG.CORRELATION_ID,
399-
state: TEST_STATE_VALUES.TEST_STATE_REDIRECT,
400-
}
401-
);
402-
expect(updateAuthoritySpy).toHaveBeenCalledWith(
403-
testCodeResponse.cloud_instance_host_name,
404-
TEST_CONFIG.CORRELATION_ID
405-
);
406-
expect(tokenResponse).toEqual(testTokenResponse);
407-
expect(acquireTokenSpy).toHaveBeenCalledWith(
408-
testAuthCodeRequest,
409-
testCodeResponse
410-
);
411-
expect(acquireTokenSpy).not.toThrow();
412-
});
413-
414334
it("successfully adds login_hint as CCS credential to auth code request", async () => {
415335
const idTokenClaims = {
416336
ver: "2.0",

0 commit comments

Comments
 (0)