Skip to content

Commit 55d25c5

Browse files
authored
Merge branch 'dev' into reliability-client-telemetry
2 parents 43437df + e2b46fb commit 55d25c5

22 files changed

+12382
-403
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "minor",
3+
"comment": "Fix ClientAssertion configuration typing between common and node #4846",
4+
"packageName": "@azure/msal-common",
5+
"email": "[email protected]",
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": "Fix ClientAssertion configuration typing between common and node #4846",
4+
"packageName": "@azure/msal-node",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

lib/msal-common/package-lock.json

Lines changed: 12259 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License.
4+
*/
5+
6+
/**
7+
* Client Assertion credential for Confidential Clients
8+
*/
9+
export type ClientAssertion = {
10+
assertion: string,
11+
assertionType: string
12+
};
13+
14+
/**
15+
* Client Credentials set for Confidential Clients
16+
*/
17+
export type ClientCredentials = {
18+
clientSecret?: string,
19+
clientAssertion?: ClientAssertion
20+
};

lib/msal-common/src/client/AuthorizationCodeClient.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,8 @@ export class AuthorizationCodeClient extends BaseClient {
226226
parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);
227227
}
228228

229-
// Use clientAssertion from request, fallback to client assertion in base configuration
230-
const clientAssertion = request.clientAssertion || this.config.clientCredentials.clientAssertion;
231-
232-
if (clientAssertion) {
229+
if (this.config.clientCredentials.clientAssertion) {
230+
const clientAssertion = this.config.clientCredentials.clientAssertion;
233231
parameterBuilder.addClientAssertion(clientAssertion.assertion);
234232
parameterBuilder.addClientAssertionType(clientAssertion.assertionType);
235233
}

lib/msal-common/src/client/OnBehalfOfClient.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,8 @@ export class OnBehalfOfClient extends BaseClient {
261261
parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);
262262
}
263263

264-
// Use clientAssertion from request, fallback to client assertion in base configuration
265-
const clientAssertion = request.clientAssertion || this.config.clientCredentials.clientAssertion;
266-
267-
if (clientAssertion) {
264+
if (this.config.clientCredentials.clientAssertion) {
265+
const clientAssertion = this.config.clientCredentials.clientAssertion;
268266
parameterBuilder.addClientAssertion(clientAssertion.assertion);
269267
parameterBuilder.addClientAssertionType(clientAssertion.assertionType);
270268
}

lib/msal-common/src/client/RefreshTokenClient.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,8 @@ export class RefreshTokenClient extends BaseClient {
199199
parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);
200200
}
201201

202-
// Use clientAssertion from request, fallback to client assertion in base configuration
203-
const clientAssertion = request.clientAssertion || this.config.clientCredentials.clientAssertion;
204-
205-
if (clientAssertion) {
202+
if (this.config.clientCredentials.clientAssertion) {
203+
const clientAssertion = this.config.clientCredentials.clientAssertion;
206204
parameterBuilder.addClientAssertion(clientAssertion.assertion);
207205
parameterBuilder.addClientAssertionType(clientAssertion.assertionType);
208206
}

lib/msal-common/src/client/UsernamePasswordClient.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,8 @@ export class UsernamePasswordClient extends BaseClient {
114114
parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);
115115
}
116116

117-
// Use clientAssertion from request, fallback to client assertion in base configuration
118-
const clientAssertion = request.clientAssertion || this.config.clientCredentials.clientAssertion;
119-
120-
if (clientAssertion) {
117+
if (this.config.clientCredentials.clientAssertion) {
118+
const clientAssertion = this.config.clientCredentials.clientAssertion;
121119
parameterBuilder.addClientAssertion(clientAssertion.assertion);
122120
parameterBuilder.addClientAssertionType(clientAssertion.assertionType);
123121
}

lib/msal-common/src/config/ClientConfiguration.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { CacheManager, DefaultStorageClass } from "../cache/CacheManager";
1515
import { ServerTelemetryManager } from "../telemetry/server/ServerTelemetryManager";
1616
import { ICachePlugin } from "../cache/interface/ICachePlugin";
1717
import { ISerializableTokenCache } from "../cache/interface/ISerializableTokenCache";
18+
import { ClientCredentials } from "../account/ClientCredentials";
1819

1920
// Token renewal offset default in seconds
2021
const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
@@ -116,20 +117,6 @@ export type LibraryInfo = {
116117
os: string
117118
};
118119

119-
/**
120-
* Credentials for confidential clients
121-
*/
122-
123-
export type ClientAssertion = {
124-
assertion: string,
125-
assertionType: string
126-
};
127-
128-
export type ClientCredentials = {
129-
clientSecret?: string,
130-
clientAssertion?: ClientAssertion
131-
};
132-
133120
/**
134121
* AzureCloudInstance specific options
135122
*

lib/msal-common/src/request/BaseAuthRequest.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import { AuthenticationScheme } from "../utils/Constants";
7-
import { AzureCloudOptions, ClientAssertion } from "../config/ClientConfiguration";
7+
import { AzureCloudOptions } from "../config/ClientConfiguration";
88

99
/**
1010
* BaseAuthRequest
@@ -21,7 +21,6 @@ import { AzureCloudOptions, ClientAssertion } from "../config/ClientConfiguratio
2121
* - sshKid - Key ID that uniquely identifies the SSH public key mentioned above.
2222
* - azureCloudOptions - Convenience string enums for users to provide public/sovereign cloud ids
2323
* - requestedClaimsHash - SHA 256 hash string of the requested claims string, used as part of an access token cache key so tokens can be filtered by requested claims
24-
* - clientAssertion - Client assertion passed by the user for confidential client flows
2524
*/
2625
export type BaseAuthRequest = {
2726
authority: string;
@@ -37,5 +36,4 @@ export type BaseAuthRequest = {
3736
sshKid?: string,
3837
azureCloudOptions?: AzureCloudOptions;
3938
requestedClaimsHash?: string;
40-
clientAssertion?: ClientAssertion;
4139
};

0 commit comments

Comments
 (0)