@azure/msal-node 1.9.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/ClientApplication.d.ts.map +1 -1
- package/dist/client/ConfidentialClientApplication.d.ts.map +1 -1
- package/dist/config/Configuration.d.ts +2 -0
- package/dist/config/Configuration.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/msal-node.cjs.development.js +223 -56
- package/dist/msal-node.cjs.development.js.map +1 -1
- package/dist/msal-node.cjs.production.min.js +1 -1
- package/dist/msal-node.cjs.production.min.js.map +1 -1
- package/dist/msal-node.esm.js +223 -56
- package/dist/msal-node.esm.js.map +1 -1
- package/dist/network/HttpClient.d.ts.map +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.d.ts.map +1 -1
- package/dist/request/ClientCredentialRequest.d.ts +3 -1
- package/dist/request/ClientCredentialRequest.d.ts.map +1 -1
- package/dist/utils/Constants.d.ts +1 -0
- package/dist/utils/Constants.d.ts.map +1 -1
- package/package.json +4 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientApplication.d.ts","sourceRoot":"","sources":["../src/client/ClientApplication.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,mBAAmB,EAEnB,oBAAoB,EAGpB,eAAe,EAEf,MAAM,EACN,sBAAsB,EAYtB,wBAAwB,EAExB,iBAAiB,EACjB,wBAAwB,EAG3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAyB,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAElG,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC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,CAAC;
|
|
1
|
+
{"version":3,"file":"ConfidentialClientApplication.d.ts","sourceRoot":"","sources":["../src/client/ConfidentialClientApplication.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,OAAO,EAKH,oBAAoB,EAMvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAE7E;;;;GAIG;AACH,qBAAa,6BAA8B,SAAQ,iBAAkB,YAAW,8BAA8B;IAE1G;;;;;;;;;;;;;;;;;;OAkBG;gBACS,aAAa,EAAE,aAAa;IAKxC;;OAEG;IACU,8BAA8B,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA4CnH;;;;;;;;;;OAUG;IACU,sBAAsB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAyBrG,OAAO,CAAC,mBAAmB;CAiC9B"}
|
|
@@ -7,6 +7,7 @@ import { LoggerOptions, INetworkModule, ProtocolMode, ICachePlugin, AzureCloudOp
|
|
|
7
7
|
* - clientAssertion - Assertion string that the application uses when requesting a token. Only used in confidential client applications. Assertion should be of type urn:ietf:params:oauth:client-assertion-type:jwt-bearer.
|
|
8
8
|
* - clientCertificate - Certificate that the application uses when requesting a token. Only used in confidential client applications. Requires hex encoded X.509 SHA-1 thumbprint of the certificiate, and the PEM encoded private key (string should contain -----BEGIN PRIVATE KEY----- ... -----END PRIVATE KEY----- )
|
|
9
9
|
* - protocolMode - Enum that represents the protocol that msal follows. Used for configuring proper endpoints.
|
|
10
|
+
* - skipAuthorityMetadataCache - A flag to choose whether to use or not use the local metadata cache during authority initialization. Defaults to false.
|
|
10
11
|
* @public
|
|
11
12
|
*/
|
|
12
13
|
export declare type NodeAuthOptions = {
|
|
@@ -25,6 +26,7 @@ export declare type NodeAuthOptions = {
|
|
|
25
26
|
clientCapabilities?: Array<string>;
|
|
26
27
|
protocolMode?: ProtocolMode;
|
|
27
28
|
azureCloudOptions?: AzureCloudOptions;
|
|
29
|
+
skipAuthorityMetadataCache?: boolean;
|
|
28
30
|
};
|
|
29
31
|
/**
|
|
30
32
|
* Use this to configure the below cache configuration options:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Configuration.d.ts","sourceRoot":"","sources":["../src/config/Configuration.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,aAAa,EACb,cAAc,EAEd,YAAY,EACZ,YAAY,EAGZ,iBAAiB,EACjB,oBAAoB,EACvB,MAAM,oBAAoB,CAAC;AAG5B
|
|
1
|
+
{"version":3,"file":"Configuration.d.ts","sourceRoot":"","sources":["../src/config/Configuration.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,aAAa,EACb,cAAc,EAEd,YAAY,EACZ,YAAY,EAGZ,iBAAiB,EACjB,oBAAoB,EACvB,MAAM,oBAAoB,CAAC;AAG5B;;;;;;;;;;GAUG;AACH,oBAAY,eAAe,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,GAAG,CAAC,EAAE,MAAM,CAAA;KACf,CAAC;IACF,gBAAgB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACjC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACnC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACxC,CAAC;AAEF;;;;;GAKG;AACH,oBAAY,YAAY,GAAG;IACvB,WAAW,CAAC,EAAE,YAAY,CAAC;CAC9B,CAAC;AAEF;;;;;;GAMG;AACH,oBAAY,iBAAiB,GAAG;IAC5B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,oBAAY,oBAAoB,GAAG;IAC/B,WAAW,CAAC,EAAE,oBAAoB,CAAC;CACtC,CAAC;AAEF;;;;;;;GAOG;AACH,oBAAY,aAAa,GAAG;IACxB,IAAI,EAAE,eAAe,CAAC;IACtB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,SAAS,CAAC,EAAE,oBAAoB,CAAC;CACpC,CAAC;AA+CF,oBAAY,iBAAiB,GAAG;IAC5B,IAAI,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;IAChC,KAAK,EAAE,YAAY,CAAC;IACpB,MAAM,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IACpC,SAAS,EAAE,QAAQ,CAAC,oBAAoB,CAAC,CAAC;CAC7C,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,EAClC,IAAI,EACJ,KAAK,EACL,MAAM,EACN,SAAS,EACZ,EAAE,aAAa,GAAG,iBAAiB,CAQnC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -25,6 +25,6 @@ export type { OnBehalfOfRequest } from "./request/OnBehalfOfRequest";
|
|
|
25
25
|
export type { UsernamePasswordRequest } from "./request/UsernamePasswordRequest";
|
|
26
26
|
export type { RefreshTokenRequest } from "./request/RefreshTokenRequest";
|
|
27
27
|
export type { SilentFlowRequest } from "./request/SilentFlowRequest";
|
|
28
|
-
export { PromptValue, ResponseMode, AuthenticationResult, AccountInfo, ValidCacheType, AuthError, AuthErrorMessage, ClientAuthError, ClientAuthErrorMessage, ClientConfigurationError, ClientConfigurationErrorMessage, InteractionRequiredAuthError, InteractionRequiredAuthErrorMessage, ServerError, INetworkModule, NetworkRequestOptions, NetworkResponse, Logger, LogLevel, ProtocolMode, ICachePlugin, TokenCacheContext, ISerializableTokenCache, AzureCloudInstance, AzureCloudOptions } from "@azure/msal-common";
|
|
28
|
+
export { PromptValue, ResponseMode, AuthorizationCodePayload, AuthenticationResult, AccountInfo, ValidCacheType, AuthError, AuthErrorMessage, ClientAuthError, ClientAuthErrorMessage, ClientConfigurationError, ClientConfigurationErrorMessage, InteractionRequiredAuthError, InteractionRequiredAuthErrorMessage, ServerError, INetworkModule, NetworkRequestOptions, NetworkResponse, Logger, LogLevel, ProtocolMode, ICachePlugin, TokenCacheContext, ISerializableTokenCache, AzureCloudInstance, AzureCloudOptions } from "@azure/msal-common";
|
|
29
29
|
export { version } from "./packageMetadata";
|
|
30
30
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAKA;;;GAGG;AAGH,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAG1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,6BAA6B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B,EAAE,MAAM,6BAA6B,CAAC;AAGrE,OAAO,EAEH,WAAW,EACX,YAAY,EACZ,wBAAwB,EAExB,oBAAoB,EAEpB,WAAW,EACX,cAAc,EAEd,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,wBAAwB,EACxB,+BAA+B,EAC/B,4BAA4B,EAC5B,mCAAmC,EACnC,WAAW,EAEX,cAAc,EACd,qBAAqB,EACrB,eAAe,EAEf,MAAM,EACN,QAAQ,EAER,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,uBAAuB,EAEvB,kBAAkB,EAClB,iBAAiB,EACpB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
6
6
|
|
|
7
7
|
var msalCommon = require('@azure/msal-common');
|
|
8
|
-
var
|
|
9
|
-
var
|
|
8
|
+
var http = _interopDefault(require('http'));
|
|
9
|
+
var https = _interopDefault(require('https'));
|
|
10
10
|
var uuid = require('uuid');
|
|
11
11
|
var crypto = _interopDefault(require('crypto'));
|
|
12
12
|
var jsonwebtoken = require('jsonwebtoken');
|
|
@@ -56,7 +56,8 @@ const CharSet = {
|
|
|
56
56
|
|
|
57
57
|
const Constants = {
|
|
58
58
|
MSAL_SKU: "msal.js.node",
|
|
59
|
-
JWT_BEARER_ASSERTION_TYPE: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"
|
|
59
|
+
JWT_BEARER_ASSERTION_TYPE: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
|
|
60
|
+
AUTHORIZATION_PENDING: "authorization_pending"
|
|
60
61
|
};
|
|
61
62
|
/**
|
|
62
63
|
* API Codes for Telemetry purposes.
|
|
@@ -109,29 +110,11 @@ class HttpClient {
|
|
|
109
110
|
* @param options
|
|
110
111
|
*/
|
|
111
112
|
async sendGetRequestAsync(url, options) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
/* istanbul ignore next */
|
|
117
|
-
headers: options && options.headers,
|
|
118
|
-
|
|
119
|
-
/* istanbul ignore next */
|
|
120
|
-
validateStatus: () => true
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
if (options && options.proxyUrl) {
|
|
124
|
-
// for axios, this has to be disabled
|
|
125
|
-
request.proxy = false;
|
|
126
|
-
request.httpsAgent = createHttpsProxyAgent(options.proxyUrl);
|
|
113
|
+
if (options != null && options.proxyUrl) {
|
|
114
|
+
return networkRequestViaProxy(url, HttpMethod.GET, options);
|
|
115
|
+
} else {
|
|
116
|
+
return networkRequestViaHttps(url, HttpMethod.GET, options);
|
|
127
117
|
}
|
|
128
|
-
|
|
129
|
-
const response = await axios(request);
|
|
130
|
-
return {
|
|
131
|
-
headers: response.headers,
|
|
132
|
-
body: response.data,
|
|
133
|
-
status: response.status
|
|
134
|
-
};
|
|
135
118
|
}
|
|
136
119
|
/**
|
|
137
120
|
* Http Post request
|
|
@@ -141,36 +124,207 @@ class HttpClient {
|
|
|
141
124
|
|
|
142
125
|
|
|
143
126
|
async sendPostRequestAsync(url, options, cancellationToken) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
127
|
+
if (options != null && options.proxyUrl) {
|
|
128
|
+
return networkRequestViaProxy(url, HttpMethod.POST, options, cancellationToken);
|
|
129
|
+
} else {
|
|
130
|
+
return networkRequestViaHttps(url, HttpMethod.POST, options, cancellationToken);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
}
|
|
147
135
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
136
|
+
const networkRequestViaProxy = (url, httpMethod, options, timeout) => {
|
|
137
|
+
const headers = (options == null ? void 0 : options.headers) || {};
|
|
138
|
+
const proxyUrl = new URL((options == null ? void 0 : options.proxyUrl) || "");
|
|
139
|
+
const destinationUrl = new URL(url); // "method: connect" must be used to establish a connection to the proxy
|
|
140
|
+
|
|
141
|
+
const tunnelRequestOptions = {
|
|
142
|
+
host: proxyUrl.hostname,
|
|
143
|
+
port: proxyUrl.port,
|
|
144
|
+
method: "CONNECT",
|
|
145
|
+
path: destinationUrl.hostname,
|
|
146
|
+
headers: headers
|
|
147
|
+
};
|
|
151
148
|
|
|
152
|
-
|
|
153
|
-
|
|
149
|
+
if (timeout) {
|
|
150
|
+
tunnelRequestOptions.timeout = timeout;
|
|
151
|
+
} // compose a request string for the socket
|
|
154
152
|
|
|
155
|
-
/* istanbul ignore next */
|
|
156
|
-
validateStatus: () => true
|
|
157
|
-
};
|
|
158
153
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
154
|
+
let postRequestStringContent = "";
|
|
155
|
+
|
|
156
|
+
if (httpMethod === HttpMethod.POST) {
|
|
157
|
+
const body = (options == null ? void 0 : options.body) || "";
|
|
158
|
+
postRequestStringContent = "Content-Type: application/x-www-form-urlencoded\r\n" + `Content-Length: ${body.length}\r\n` + `\r\n${body}`;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const outgoingRequestString = `${httpMethod.toUpperCase()} ${destinationUrl.href} HTTP/1.1\r\n` + `Host: ${destinationUrl.host}\r\n` + "Connection: close\r\n" + postRequestStringContent + "\r\n";
|
|
162
|
+
return new Promise((resolve, reject) => {
|
|
163
|
+
const request = http.request(tunnelRequestOptions);
|
|
164
|
+
|
|
165
|
+
if (tunnelRequestOptions.timeout) {
|
|
166
|
+
request.on("timeout", () => {
|
|
167
|
+
request.destroy();
|
|
168
|
+
reject(new Error("Request time out"));
|
|
169
|
+
});
|
|
163
170
|
}
|
|
164
171
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
172
|
+
request.end(); // establish connection to the proxy
|
|
173
|
+
|
|
174
|
+
request.on("connect", (response, socket) => {
|
|
175
|
+
const statusCode = (response == null ? void 0 : response.statusCode) || 500;
|
|
176
|
+
|
|
177
|
+
if (statusCode < 200 || statusCode > 299) {
|
|
178
|
+
request.destroy();
|
|
179
|
+
socket.destroy();
|
|
180
|
+
reject(new Error(`HTTP status code ${statusCode}`));
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (tunnelRequestOptions.timeout) {
|
|
184
|
+
socket.setTimeout(tunnelRequestOptions.timeout);
|
|
185
|
+
socket.on("timeout", () => {
|
|
186
|
+
request.destroy();
|
|
187
|
+
socket.destroy();
|
|
188
|
+
reject(new Error("Request time out"));
|
|
189
|
+
});
|
|
190
|
+
} // make a request over an HTTP tunnel
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
socket.write(outgoingRequestString);
|
|
194
|
+
const data = [];
|
|
195
|
+
socket.on("data", chunk => {
|
|
196
|
+
data.push(chunk);
|
|
197
|
+
});
|
|
198
|
+
socket.on("end", () => {
|
|
199
|
+
// combine all received buffer streams into one buffer, and then into a string
|
|
200
|
+
const dataString = Buffer.concat([...data]).toString(); // separate each line into it's own entry in an arry
|
|
201
|
+
|
|
202
|
+
const dataStringArray = dataString.split("\r\n"); // the first entry will contain the statusCode
|
|
203
|
+
|
|
204
|
+
const statusCode = parseInt(dataStringArray[0].split(" ")[1]); // the last entry will contain the body
|
|
205
|
+
|
|
206
|
+
const body = dataStringArray[dataStringArray.length - 1]; // everything in between the first and last entries are the headers
|
|
207
|
+
|
|
208
|
+
const headersArray = dataStringArray.slice(1, dataStringArray.length - 2); // build an object out of all the headers
|
|
209
|
+
|
|
210
|
+
const entries = new Map();
|
|
211
|
+
headersArray.forEach(header => {
|
|
212
|
+
/**
|
|
213
|
+
* the header might look like "Content-Length: 1531", but that is just a string
|
|
214
|
+
* it needs to be converted to a key/value pair
|
|
215
|
+
* split the string at the first instance of ":"
|
|
216
|
+
* there may be more than one ":" if the value of the header is supposed to be a JSON object
|
|
217
|
+
*/
|
|
218
|
+
const headerKeyValue = header.split(new RegExp(/:\s(.*)/s));
|
|
219
|
+
const headerKey = headerKeyValue[0];
|
|
220
|
+
let headerValue = headerKeyValue[1]; // check if the value of the header is supposed to be a JSON object
|
|
221
|
+
|
|
222
|
+
try {
|
|
223
|
+
const object = JSON.parse(headerValue); // if it is, then convert it from a string to a JSON object
|
|
224
|
+
|
|
225
|
+
if (object && typeof object === "object") {
|
|
226
|
+
headerValue = object;
|
|
227
|
+
}
|
|
228
|
+
} catch (e) {// otherwise, leave it as a string
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
entries.set(headerKey, headerValue);
|
|
232
|
+
});
|
|
233
|
+
const headers = Object.fromEntries(entries);
|
|
234
|
+
const networkResponse = {
|
|
235
|
+
headers: headers,
|
|
236
|
+
body: JSON.parse(body),
|
|
237
|
+
status: statusCode
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
if ((statusCode < 200 || statusCode > 299) && // do not destroy the request for the device code flow
|
|
241
|
+
networkResponse.body["error"] !== Constants.AUTHORIZATION_PENDING) {
|
|
242
|
+
request.destroy();
|
|
243
|
+
socket.destroy();
|
|
244
|
+
reject(new Error(`HTTP status code ${statusCode}`));
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
resolve(networkResponse);
|
|
248
|
+
});
|
|
249
|
+
socket.on("error", chunk => {
|
|
250
|
+
request.destroy();
|
|
251
|
+
socket.destroy();
|
|
252
|
+
reject(new Error(chunk.toString()));
|
|
253
|
+
});
|
|
254
|
+
});
|
|
255
|
+
request.on("error", chunk => {
|
|
256
|
+
request.destroy();
|
|
257
|
+
reject(new Error(chunk.toString()));
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
const networkRequestViaHttps = (url, httpMethod, options, timeout) => {
|
|
263
|
+
const isPostRequest = httpMethod === HttpMethod.POST;
|
|
264
|
+
const body = (options == null ? void 0 : options.body) || "";
|
|
265
|
+
const emptyHeaders = {};
|
|
266
|
+
const customOptions = {
|
|
267
|
+
method: httpMethod,
|
|
268
|
+
headers: (options == null ? void 0 : options.headers) || emptyHeaders
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
if (timeout) {
|
|
272
|
+
customOptions.timeout = timeout;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
if (isPostRequest) {
|
|
276
|
+
// needed for post request to work
|
|
277
|
+
customOptions.headers = { ...customOptions.headers,
|
|
278
|
+
"Content-Length": body.length
|
|
170
279
|
};
|
|
171
280
|
}
|
|
172
281
|
|
|
173
|
-
|
|
282
|
+
return new Promise((resolve, reject) => {
|
|
283
|
+
const request = https.request(url, customOptions);
|
|
284
|
+
|
|
285
|
+
if (timeout) {
|
|
286
|
+
request.on("timeout", () => {
|
|
287
|
+
request.destroy();
|
|
288
|
+
reject(new Error("Request time out"));
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
if (isPostRequest) {
|
|
293
|
+
request.write(body);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
request.end();
|
|
297
|
+
request.on("response", response => {
|
|
298
|
+
const headers = response.headers;
|
|
299
|
+
const statusCode = response.statusCode;
|
|
300
|
+
const data = [];
|
|
301
|
+
response.on("data", chunk => {
|
|
302
|
+
data.push(chunk);
|
|
303
|
+
});
|
|
304
|
+
response.on("end", () => {
|
|
305
|
+
// combine all received buffer streams into one buffer, and then into a string
|
|
306
|
+
const body = Buffer.concat([...data]).toString();
|
|
307
|
+
const networkResponse = {
|
|
308
|
+
headers: headers,
|
|
309
|
+
body: JSON.parse(body),
|
|
310
|
+
status: statusCode
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
if ((statusCode < 200 || statusCode > 299) && // do not destroy the request for the device code flow
|
|
314
|
+
networkResponse.body["error"] !== Constants.AUTHORIZATION_PENDING) {
|
|
315
|
+
request.destroy();
|
|
316
|
+
reject(new Error(`HTTP status code ${statusCode}`));
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
resolve(networkResponse);
|
|
320
|
+
});
|
|
321
|
+
});
|
|
322
|
+
request.on("error", chunk => {
|
|
323
|
+
request.destroy();
|
|
324
|
+
reject(new Error(chunk.toString()));
|
|
325
|
+
});
|
|
326
|
+
});
|
|
327
|
+
};
|
|
174
328
|
|
|
175
329
|
/*
|
|
176
330
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -208,7 +362,8 @@ const DEFAULT_AUTH_OPTIONS = {
|
|
|
208
362
|
azureCloudOptions: {
|
|
209
363
|
azureCloudInstance: msalCommon.AzureCloudInstance.None,
|
|
210
364
|
tenant: msalCommon.Constants.EMPTY_STRING
|
|
211
|
-
}
|
|
365
|
+
},
|
|
366
|
+
skipAuthorityMetadataCache: false
|
|
212
367
|
};
|
|
213
368
|
const DEFAULT_CACHE_OPTIONS = {};
|
|
214
369
|
const DEFAULT_LOGGER_OPTIONS = {
|
|
@@ -1603,7 +1758,7 @@ class TokenCache {
|
|
|
1603
1758
|
|
|
1604
1759
|
/* eslint-disable header/header */
|
|
1605
1760
|
const name = "@azure/msal-node";
|
|
1606
|
-
const version = "1.
|
|
1761
|
+
const version = "1.11.0";
|
|
1607
1762
|
|
|
1608
1763
|
/*
|
|
1609
1764
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1915,9 +2070,10 @@ class ClientApplication {
|
|
|
1915
2070
|
knownAuthorities: this.config.auth.knownAuthorities,
|
|
1916
2071
|
cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,
|
|
1917
2072
|
authorityMetadata: this.config.auth.authorityMetadata,
|
|
1918
|
-
azureRegionConfiguration
|
|
2073
|
+
azureRegionConfiguration,
|
|
2074
|
+
skipAuthorityMetadataCache: this.config.auth.skipAuthorityMetadataCache
|
|
1919
2075
|
};
|
|
1920
|
-
return await msalCommon.AuthorityFactory.createDiscoveredInstance(authorityUrl, this.config.system.networkClient, this.storage, authorityOptions);
|
|
2076
|
+
return await msalCommon.AuthorityFactory.createDiscoveredInstance(authorityUrl, this.config.system.networkClient, this.storage, authorityOptions, this.config.system.proxyUrl);
|
|
1921
2077
|
}
|
|
1922
2078
|
/**
|
|
1923
2079
|
* Clear the cache
|
|
@@ -2117,13 +2273,13 @@ class ClientAssertion {
|
|
|
2117
2273
|
* "." means any string character, "+" means match 1 or more times, and "?" means the shortest match.
|
|
2118
2274
|
* The "g" at the end of the regex means search the string globally, and the "s" enables the "." to match newlines.
|
|
2119
2275
|
*/
|
|
2120
|
-
const regexToFindCerts = /-----BEGIN CERTIFICATE-----\n(.+?)\n-----END CERTIFICATE-----/gs;
|
|
2276
|
+
const regexToFindCerts = /-----BEGIN CERTIFICATE-----\r*\n(.+?)\r*\n-----END CERTIFICATE-----/gs;
|
|
2121
2277
|
const certs = [];
|
|
2122
2278
|
let matches;
|
|
2123
2279
|
|
|
2124
2280
|
while ((matches = regexToFindCerts.exec(publicCertificate)) !== null) {
|
|
2125
2281
|
// matches[1] represents the first parens capture group in the regex.
|
|
2126
|
-
certs.push(matches[1].replace(/\n
|
|
2282
|
+
certs.push(matches[1].replace(/\r*\n/g, msalCommon.Constants.EMPTY_STRING));
|
|
2127
2283
|
}
|
|
2128
2284
|
|
|
2129
2285
|
return certs;
|
|
@@ -2171,9 +2327,20 @@ class ConfidentialClientApplication extends ClientApplication {
|
|
|
2171
2327
|
|
|
2172
2328
|
|
|
2173
2329
|
async acquireTokenByClientCredential(request) {
|
|
2174
|
-
this.logger.info("acquireTokenByClientCredential called", request.correlationId);
|
|
2330
|
+
this.logger.info("acquireTokenByClientCredential called", request.correlationId); // If there is a client assertion present in the request, it overrides the one present in the client configuration
|
|
2331
|
+
|
|
2332
|
+
let clientAssertion;
|
|
2333
|
+
|
|
2334
|
+
if (request.clientAssertion) {
|
|
2335
|
+
clientAssertion = {
|
|
2336
|
+
assertion: request.clientAssertion,
|
|
2337
|
+
assertionType: Constants.JWT_BEARER_ASSERTION_TYPE
|
|
2338
|
+
};
|
|
2339
|
+
}
|
|
2340
|
+
|
|
2175
2341
|
const validRequest = { ...request,
|
|
2176
|
-
...(await this.initializeBaseRequest(request))
|
|
2342
|
+
...(await this.initializeBaseRequest(request)),
|
|
2343
|
+
clientAssertion
|
|
2177
2344
|
};
|
|
2178
2345
|
const azureRegionConfiguration = {
|
|
2179
2346
|
azureRegion: validRequest.azureRegion,
|
|
@@ -2215,8 +2382,8 @@ class ConfidentialClientApplication extends ClientApplication {
|
|
|
2215
2382
|
};
|
|
2216
2383
|
|
|
2217
2384
|
try {
|
|
2218
|
-
const
|
|
2219
|
-
const oboClient = new msalCommon.OnBehalfOfClient(
|
|
2385
|
+
const onBehalfOfConfig = await this.buildOauthClientConfiguration(validRequest.authority, validRequest.correlationId, undefined, undefined, request.azureCloudOptions);
|
|
2386
|
+
const oboClient = new msalCommon.OnBehalfOfClient(onBehalfOfConfig);
|
|
2220
2387
|
this.logger.verbose("On behalf of client created", validRequest.correlationId);
|
|
2221
2388
|
return oboClient.acquireToken(validRequest);
|
|
2222
2389
|
} catch (e) {
|