@azure/msal-node 5.0.0-alpha.0 → 5.0.0-beta.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/cache/CacheHelpers.mjs +1 -1
- package/dist/cache/NodeStorage.mjs +1 -1
- package/dist/cache/NodeStorage.mjs.map +1 -1
- package/dist/cache/TokenCache.mjs +1 -1
- package/dist/cache/TokenCache.mjs.map +1 -1
- package/dist/cache/distributed/DistributedCachePlugin.mjs +1 -1
- package/dist/cache/distributed/DistributedCachePlugin.mjs.map +1 -1
- package/dist/cache/serializer/Deserializer.mjs +1 -1
- package/dist/cache/serializer/Deserializer.mjs.map +1 -1
- package/dist/cache/serializer/Serializer.mjs +1 -1
- package/dist/cache/serializer/Serializer.mjs.map +1 -1
- package/dist/client/BaseClient.d.ts +42 -0
- package/dist/client/BaseClient.d.ts.map +1 -0
- package/dist/client/BaseClient.mjs +68 -0
- package/dist/client/BaseClient.mjs.map +1 -0
- package/dist/client/ClientApplication.mjs +1 -1
- package/dist/client/ClientApplication.mjs.map +1 -1
- package/dist/client/ClientAssertion.mjs +1 -1
- package/dist/client/ClientAssertion.mjs.map +1 -1
- package/dist/client/ClientCredentialClient.d.ts +2 -1
- package/dist/client/ClientCredentialClient.d.ts.map +1 -1
- package/dist/client/ClientCredentialClient.mjs +4 -3
- package/dist/client/ClientCredentialClient.mjs.map +1 -1
- package/dist/client/ConfidentialClientApplication.mjs +1 -1
- package/dist/client/ConfidentialClientApplication.mjs.map +1 -1
- package/dist/client/DeviceCodeClient.d.ts +2 -1
- package/dist/client/DeviceCodeClient.d.ts.map +1 -1
- package/dist/client/DeviceCodeClient.mjs +6 -5
- package/dist/client/DeviceCodeClient.mjs.map +1 -1
- package/dist/client/ManagedIdentityApplication.mjs +1 -1
- package/dist/client/ManagedIdentityApplication.mjs.map +1 -1
- package/dist/client/ManagedIdentityClient.mjs +1 -1
- package/dist/client/ManagedIdentityClient.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/AppService.d.ts +54 -0
- package/dist/client/ManagedIdentitySources/AppService.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/AppService.mjs +55 -1
- package/dist/client/ManagedIdentitySources/AppService.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/AzureArc.d.ts +81 -0
- package/dist/client/ManagedIdentitySources/AzureArc.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/AzureArc.mjs +82 -1
- package/dist/client/ManagedIdentitySources/AzureArc.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts +93 -2
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +81 -1
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/CloudShell.d.ts +54 -0
- package/dist/client/ManagedIdentitySources/CloudShell.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/CloudShell.mjs +55 -1
- package/dist/client/ManagedIdentitySources/CloudShell.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/Imds.d.ts +44 -22
- package/dist/client/ManagedIdentitySources/Imds.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/Imds.mjs +44 -22
- package/dist/client/ManagedIdentitySources/Imds.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/MachineLearning.d.ts +65 -0
- package/dist/client/ManagedIdentitySources/MachineLearning.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/MachineLearning.mjs +66 -1
- package/dist/client/ManagedIdentitySources/MachineLearning.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts +56 -22
- package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/ServiceFabric.mjs +57 -23
- package/dist/client/ManagedIdentitySources/ServiceFabric.mjs.map +1 -1
- package/dist/client/OnBehalfOfClient.d.ts +2 -1
- package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
- package/dist/client/OnBehalfOfClient.mjs +4 -3
- package/dist/client/OnBehalfOfClient.mjs.map +1 -1
- package/dist/client/PublicClientApplication.d.ts.map +1 -1
- package/dist/client/PublicClientApplication.mjs +21 -5
- package/dist/client/PublicClientApplication.mjs.map +1 -1
- package/dist/client/UsernamePasswordClient.d.ts +2 -1
- package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
- package/dist/client/UsernamePasswordClient.mjs +4 -3
- package/dist/client/UsernamePasswordClient.mjs.map +1 -1
- package/dist/config/Configuration.d.ts +0 -6
- package/dist/config/Configuration.d.ts.map +1 -1
- package/dist/config/Configuration.mjs +3 -5
- package/dist/config/Configuration.mjs.map +1 -1
- package/dist/config/ManagedIdentityId.mjs +1 -1
- package/dist/config/ManagedIdentityId.mjs.map +1 -1
- package/dist/config/ManagedIdentityRequestParameters.mjs +3 -3
- package/dist/config/ManagedIdentityRequestParameters.mjs.map +1 -1
- package/dist/crypto/CryptoProvider.mjs +1 -1
- package/dist/crypto/CryptoProvider.mjs.map +1 -1
- package/dist/crypto/GuidGenerator.mjs +1 -1
- package/dist/crypto/GuidGenerator.mjs.map +1 -1
- package/dist/crypto/HashUtils.mjs +1 -1
- package/dist/crypto/HashUtils.mjs.map +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/crypto/PkceGenerator.mjs.map +1 -1
- package/dist/error/ClientAuthErrorCodes.mjs +1 -1
- package/dist/error/ManagedIdentityError.mjs +1 -1
- package/dist/error/ManagedIdentityError.mjs.map +1 -1
- package/dist/error/ManagedIdentityErrorCodes.mjs +1 -1
- package/dist/error/ManagedIdentityErrorCodes.mjs.map +1 -1
- package/dist/error/NodeAuthError.d.ts +8 -0
- package/dist/error/NodeAuthError.d.ts.map +1 -1
- package/dist/error/NodeAuthError.mjs +11 -1
- package/dist/error/NodeAuthError.mjs.map +1 -1
- package/dist/index.d.ts +0 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +1 -7
- package/dist/index.mjs.map +1 -1
- package/dist/internals.mjs +1 -1
- package/dist/network/HttpClient.d.ts +54 -14
- package/dist/network/HttpClient.d.ts.map +1 -1
- package/dist/network/HttpClient.mjs +140 -262
- package/dist/network/HttpClient.mjs.map +1 -1
- package/dist/network/HttpClientWithRetries.mjs +1 -1
- package/dist/network/HttpClientWithRetries.mjs.map +1 -1
- package/dist/network/LoopbackClient.mjs +1 -1
- package/dist/network/LoopbackClient.mjs.map +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.d.ts.map +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/protocol/Authorize.mjs +2 -2
- package/dist/protocol/Authorize.mjs.map +1 -1
- package/dist/request/AuthorizationCodeRequest.d.ts +2 -1
- package/dist/request/AuthorizationCodeRequest.d.ts.map +1 -1
- package/dist/request/AuthorizationUrlRequest.d.ts +2 -2
- package/dist/request/ClientCredentialRequest.d.ts +0 -1
- package/dist/request/ClientCredentialRequest.d.ts.map +1 -1
- package/dist/request/CommonClientCredentialRequest.d.ts +3 -2
- package/dist/request/CommonClientCredentialRequest.d.ts.map +1 -1
- package/dist/request/CommonDeviceCodeRequest.d.ts +3 -2
- package/dist/request/CommonDeviceCodeRequest.d.ts.map +1 -1
- package/dist/request/CommonOnBehalfOfRequest.d.ts +1 -2
- package/dist/request/CommonOnBehalfOfRequest.d.ts.map +1 -1
- package/dist/request/CommonUsernamePasswordRequest.d.ts +2 -1
- package/dist/request/CommonUsernamePasswordRequest.d.ts.map +1 -1
- package/dist/request/InteractiveRequest.d.ts +1 -1
- package/dist/request/InteractiveRequest.d.ts.map +1 -1
- package/dist/request/OnBehalfOfRequest.d.ts +0 -1
- package/dist/request/OnBehalfOfRequest.d.ts.map +1 -1
- package/dist/request/RefreshTokenRequest.d.ts +2 -1
- package/dist/request/RefreshTokenRequest.d.ts.map +1 -1
- package/dist/request/SilentFlowRequest.d.ts +2 -1
- package/dist/request/SilentFlowRequest.d.ts.map +1 -1
- package/dist/request/UsernamePasswordRequest.d.ts +2 -1
- package/dist/request/UsernamePasswordRequest.d.ts.map +1 -1
- package/dist/retry/DefaultManagedIdentityRetryPolicy.mjs +1 -1
- package/dist/retry/DefaultManagedIdentityRetryPolicy.mjs.map +1 -1
- package/dist/retry/ExponentialRetryStrategy.mjs +1 -1
- package/dist/retry/ExponentialRetryStrategy.mjs.map +1 -1
- package/dist/retry/ImdsRetryPolicy.mjs +1 -1
- package/dist/retry/ImdsRetryPolicy.mjs.map +1 -1
- package/dist/retry/LinearRetryStrategy.mjs +1 -1
- package/dist/retry/LinearRetryStrategy.mjs.map +1 -1
- package/dist/utils/Constants.d.ts +2 -9
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.mjs +4 -12
- package/dist/utils/Constants.mjs.map +1 -1
- package/dist/utils/EncodingUtils.mjs +1 -1
- package/dist/utils/EncodingUtils.mjs.map +1 -1
- package/dist/utils/TimeUtils.mjs +1 -1
- package/dist/utils/TimeUtils.mjs.map +1 -1
- package/lib/msal-node.cjs +5747 -5335
- package/lib/msal-node.cjs.map +1 -1
- package/lib/types/client/BaseClient.d.ts +42 -0
- package/lib/types/client/BaseClient.d.ts.map +1 -0
- package/lib/types/client/ClientCredentialClient.d.ts +2 -1
- package/lib/types/client/ClientCredentialClient.d.ts.map +1 -1
- package/lib/types/client/DeviceCodeClient.d.ts +2 -1
- package/lib/types/client/DeviceCodeClient.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentitySources/AppService.d.ts +54 -0
- package/lib/types/client/ManagedIdentitySources/AppService.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentitySources/AzureArc.d.ts +81 -0
- package/lib/types/client/ManagedIdentitySources/AzureArc.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts +93 -2
- package/lib/types/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentitySources/CloudShell.d.ts +54 -0
- package/lib/types/client/ManagedIdentitySources/CloudShell.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentitySources/Imds.d.ts +44 -22
- package/lib/types/client/ManagedIdentitySources/Imds.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentitySources/MachineLearning.d.ts +65 -0
- package/lib/types/client/ManagedIdentitySources/MachineLearning.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentitySources/ServiceFabric.d.ts +56 -22
- package/lib/types/client/ManagedIdentitySources/ServiceFabric.d.ts.map +1 -1
- package/lib/types/client/OnBehalfOfClient.d.ts +2 -1
- package/lib/types/client/OnBehalfOfClient.d.ts.map +1 -1
- package/lib/types/client/PublicClientApplication.d.ts.map +1 -1
- package/lib/types/client/UsernamePasswordClient.d.ts +2 -1
- package/lib/types/client/UsernamePasswordClient.d.ts.map +1 -1
- package/lib/types/config/Configuration.d.ts +0 -6
- package/lib/types/config/Configuration.d.ts.map +1 -1
- package/lib/types/error/NodeAuthError.d.ts +8 -0
- package/lib/types/error/NodeAuthError.d.ts.map +1 -1
- package/lib/types/index.d.ts +0 -6
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/network/HttpClient.d.ts +54 -14
- package/lib/types/network/HttpClient.d.ts.map +1 -1
- package/lib/types/packageMetadata.d.ts +1 -1
- package/lib/types/packageMetadata.d.ts.map +1 -1
- package/lib/types/request/AuthorizationCodeRequest.d.ts +2 -1
- package/lib/types/request/AuthorizationCodeRequest.d.ts.map +1 -1
- package/lib/types/request/AuthorizationUrlRequest.d.ts +2 -2
- package/lib/types/request/ClientCredentialRequest.d.ts +0 -1
- package/lib/types/request/ClientCredentialRequest.d.ts.map +1 -1
- package/lib/types/request/CommonClientCredentialRequest.d.ts +3 -2
- package/lib/types/request/CommonClientCredentialRequest.d.ts.map +1 -1
- package/lib/types/request/CommonDeviceCodeRequest.d.ts +3 -2
- package/lib/types/request/CommonDeviceCodeRequest.d.ts.map +1 -1
- package/lib/types/request/CommonOnBehalfOfRequest.d.ts +1 -2
- package/lib/types/request/CommonOnBehalfOfRequest.d.ts.map +1 -1
- package/lib/types/request/CommonUsernamePasswordRequest.d.ts +2 -1
- package/lib/types/request/CommonUsernamePasswordRequest.d.ts.map +1 -1
- package/lib/types/request/InteractiveRequest.d.ts +1 -1
- package/lib/types/request/InteractiveRequest.d.ts.map +1 -1
- package/lib/types/request/OnBehalfOfRequest.d.ts +0 -1
- package/lib/types/request/OnBehalfOfRequest.d.ts.map +1 -1
- package/lib/types/request/RefreshTokenRequest.d.ts +2 -1
- package/lib/types/request/RefreshTokenRequest.d.ts.map +1 -1
- package/lib/types/request/SilentFlowRequest.d.ts +2 -1
- package/lib/types/request/SilentFlowRequest.d.ts.map +1 -1
- package/lib/types/request/UsernamePasswordRequest.d.ts +2 -1
- package/lib/types/request/UsernamePasswordRequest.d.ts.map +1 -1
- package/lib/types/utils/Constants.d.ts +2 -9
- package/lib/types/utils/Constants.d.ts.map +1 -1
- package/package.json +88 -88
- package/src/client/BaseClient.ts +158 -0
- package/src/client/ClientCredentialClient.ts +2 -3
- package/src/client/DeviceCodeClient.ts +4 -5
- package/src/client/ManagedIdentitySources/AppService.ts +54 -0
- package/src/client/ManagedIdentitySources/AzureArc.ts +81 -0
- package/src/client/ManagedIdentitySources/BaseManagedIdentitySource.ts +92 -2
- package/src/client/ManagedIdentitySources/CloudShell.ts +54 -0
- package/src/client/ManagedIdentitySources/Imds.ts +43 -21
- package/src/client/ManagedIdentitySources/MachineLearning.ts +65 -0
- package/src/client/ManagedIdentitySources/ServiceFabric.ts +56 -22
- package/src/client/OnBehalfOfClient.ts +2 -3
- package/src/client/PublicClientApplication.ts +22 -4
- package/src/client/UsernamePasswordClient.ts +2 -3
- package/src/config/Configuration.ts +2 -14
- package/src/config/ManagedIdentityRequestParameters.ts +2 -2
- package/src/error/NodeAuthError.ts +14 -0
- package/src/index.ts +0 -8
- package/src/network/HttpClient.ts +166 -372
- package/src/packageMetadata.ts +1 -1
- package/src/protocol/Authorize.ts +1 -1
- package/src/request/AuthorizationCodeRequest.ts +2 -1
- package/src/request/AuthorizationUrlRequest.ts +2 -2
- package/src/request/ClientCredentialRequest.ts +0 -1
- package/src/request/CommonClientCredentialRequest.ts +6 -2
- package/src/request/CommonDeviceCodeRequest.ts +3 -6
- package/src/request/CommonOnBehalfOfRequest.ts +4 -2
- package/src/request/CommonUsernamePasswordRequest.ts +2 -1
- package/src/request/InteractiveRequest.ts +1 -4
- package/src/request/OnBehalfOfRequest.ts +0 -1
- package/src/request/RefreshTokenRequest.ts +2 -1
- package/src/request/SilentFlowRequest.ts +2 -1
- package/src/request/UsernamePasswordRequest.ts +2 -1
- package/src/utils/Constants.ts +2 -11
- package/dist/utils/NetworkUtils.mjs +0 -43
- package/dist/utils/NetworkUtils.mjs.map +0 -1
|
@@ -4,424 +4,218 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
|
-
|
|
7
|
+
AuthError,
|
|
8
|
+
ClientAuthErrorCodes,
|
|
8
9
|
INetworkModule,
|
|
9
10
|
NetworkRequestOptions,
|
|
10
11
|
NetworkResponse,
|
|
12
|
+
createAuthError,
|
|
13
|
+
createNetworkError,
|
|
11
14
|
} from "@azure/msal-common/node";
|
|
12
|
-
import { HttpMethod
|
|
13
|
-
import { NetworkUtils } from "../utils/NetworkUtils.js";
|
|
14
|
-
import http from "http";
|
|
15
|
-
import https from "https";
|
|
15
|
+
import { HttpMethod } from "../utils/Constants.js";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* HTTP client implementation using Node.js native fetch API.
|
|
19
|
+
*
|
|
20
|
+
* This class provides a clean interface for making HTTP requests using the modern
|
|
21
|
+
* fetch API available in Node.js 18+. It replaces the previous implementation that
|
|
22
|
+
* relied on custom proxy handling and the legacy http/https modules.
|
|
19
23
|
*/
|
|
20
24
|
export class HttpClient implements INetworkModule {
|
|
21
|
-
private proxyUrl: string;
|
|
22
|
-
private customAgentOptions: http.AgentOptions | https.AgentOptions;
|
|
23
|
-
|
|
24
|
-
constructor(
|
|
25
|
-
proxyUrl?: string,
|
|
26
|
-
customAgentOptions?: http.AgentOptions | https.AgentOptions
|
|
27
|
-
) {
|
|
28
|
-
this.proxyUrl = proxyUrl || "";
|
|
29
|
-
this.customAgentOptions = customAgentOptions || {};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
25
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
26
|
+
* Sends an HTTP GET request to the specified URL.
|
|
27
|
+
*
|
|
28
|
+
* This method handles GET requests with optional timeout support. The timeout
|
|
29
|
+
* is implemented using AbortController, which provides a clean way to cancel
|
|
30
|
+
* fetch requests that take too long to complete.
|
|
31
|
+
*
|
|
32
|
+
* @param url - The target URL for the GET request
|
|
33
|
+
* @param options - Optional request configuration including headers
|
|
34
|
+
* @param timeout - Optional timeout in milliseconds. If specified, the request
|
|
35
|
+
* will be aborted if it doesn't complete within this time
|
|
36
|
+
* @returns Promise that resolves to a NetworkResponse containing headers, body, and status
|
|
37
|
+
* @throws {AuthError} When the request times out or response parsing fails
|
|
38
|
+
* @throws {NetworkError} When the network request fails
|
|
36
39
|
*/
|
|
37
40
|
async sendGetRequestAsync<T>(
|
|
38
41
|
url: string,
|
|
39
42
|
options?: NetworkRequestOptions,
|
|
40
43
|
timeout?: number
|
|
41
44
|
): Promise<NetworkResponse<T>> {
|
|
42
|
-
|
|
43
|
-
return networkRequestViaProxy(
|
|
44
|
-
url,
|
|
45
|
-
this.proxyUrl,
|
|
46
|
-
HttpMethod.GET,
|
|
47
|
-
options,
|
|
48
|
-
this.customAgentOptions as http.AgentOptions,
|
|
49
|
-
timeout
|
|
50
|
-
);
|
|
51
|
-
} else {
|
|
52
|
-
return networkRequestViaHttps(
|
|
53
|
-
url,
|
|
54
|
-
HttpMethod.GET,
|
|
55
|
-
options,
|
|
56
|
-
this.customAgentOptions as https.AgentOptions,
|
|
57
|
-
timeout
|
|
58
|
-
);
|
|
59
|
-
}
|
|
45
|
+
return this.sendRequest<T>(url, HttpMethod.GET, options, timeout);
|
|
60
46
|
}
|
|
61
47
|
|
|
62
48
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
49
|
+
* Sends an HTTP POST request to the specified URL.
|
|
50
|
+
*
|
|
51
|
+
* This method handles POST requests with request body support. Currently,
|
|
52
|
+
* timeout functionality is not exposed for POST requests, but the underlying
|
|
53
|
+
* implementation supports it through the shared sendRequest method.
|
|
54
|
+
*
|
|
55
|
+
* @param url - The target URL for the POST request
|
|
56
|
+
* @param options - Optional request configuration including headers and body
|
|
57
|
+
* @returns Promise that resolves to a NetworkResponse containing headers, body, and status
|
|
58
|
+
* @throws {AuthError} When the request times out or response parsing fails
|
|
59
|
+
* @throws {NetworkError} When the network request fails
|
|
66
60
|
*/
|
|
67
61
|
async sendPostRequestAsync<T>(
|
|
68
62
|
url: string,
|
|
69
63
|
options?: NetworkRequestOptions
|
|
70
64
|
): Promise<NetworkResponse<T>> {
|
|
71
|
-
|
|
72
|
-
return networkRequestViaProxy(
|
|
73
|
-
url,
|
|
74
|
-
this.proxyUrl,
|
|
75
|
-
HttpMethod.POST,
|
|
76
|
-
options,
|
|
77
|
-
this.customAgentOptions as http.AgentOptions
|
|
78
|
-
);
|
|
79
|
-
} else {
|
|
80
|
-
return networkRequestViaHttps(
|
|
81
|
-
url,
|
|
82
|
-
HttpMethod.POST,
|
|
83
|
-
options,
|
|
84
|
-
this.customAgentOptions as https.AgentOptions
|
|
85
|
-
);
|
|
86
|
-
}
|
|
65
|
+
return this.sendRequest<T>(url, HttpMethod.POST, options);
|
|
87
66
|
}
|
|
88
|
-
}
|
|
89
67
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
)
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Core HTTP request implementation using native fetch API.
|
|
70
|
+
*
|
|
71
|
+
* This method handles GET and POST HTTP requests with comprehensive
|
|
72
|
+
* timeout support and error handling. The timeout mechanism works as follows:
|
|
73
|
+
*
|
|
74
|
+
* 1. An AbortController is created for each request
|
|
75
|
+
* 2. If a timeout is specified, setTimeout is used to call abort() after the delay
|
|
76
|
+
* 3. The abort signal is passed to fetch, which will reject the promise if aborted
|
|
77
|
+
* 4. Cleanup occurs in both success and error cases to prevent timer leaks
|
|
78
|
+
*
|
|
79
|
+
* Error handling priority:
|
|
80
|
+
* 1. Timeout errors (AbortError) are converted to "Request timeout" messages
|
|
81
|
+
* 2. Network/connection errors are wrapped with "Network request failed" prefix
|
|
82
|
+
* 3. JSON parsing errors are wrapped with "Failed to parse response" prefix
|
|
83
|
+
*
|
|
84
|
+
* @param url - The target URL for the request
|
|
85
|
+
* @param method - HTTP method (GET or POST)
|
|
86
|
+
* @param options - Optional request configuration (headers, body)
|
|
87
|
+
* @param timeout - Optional timeout in milliseconds for request cancellation
|
|
88
|
+
* @returns Promise resolving to NetworkResponse with parsed JSON body
|
|
89
|
+
* @throws {AuthError} For timeouts or JSON parsing errors
|
|
90
|
+
* @throws {NetworkError} For network failures
|
|
91
|
+
*/
|
|
92
|
+
private async sendRequest<T>(
|
|
93
|
+
url: string,
|
|
94
|
+
method: string,
|
|
95
|
+
options?: NetworkRequestOptions,
|
|
96
|
+
timeout?: number
|
|
97
|
+
): Promise<NetworkResponse<T>> {
|
|
98
|
+
/*
|
|
99
|
+
* Setup timeout mechanism using AbortController
|
|
100
|
+
* This provides a standard way to cancel fetch requests
|
|
101
|
+
*/
|
|
102
|
+
const controller = new AbortController();
|
|
103
|
+
let timeoutId: NodeJS.Timeout | undefined;
|
|
104
|
+
|
|
105
|
+
/*
|
|
106
|
+
* Configure timeout if specified
|
|
107
|
+
* The setTimeout will trigger abort() if the request takes too long
|
|
108
|
+
*/
|
|
125
109
|
if (timeout) {
|
|
126
|
-
|
|
110
|
+
timeoutId = setTimeout(() => {
|
|
111
|
+
// Calling abort() will cause fetch to reject with AbortError
|
|
112
|
+
controller.abort();
|
|
113
|
+
}, timeout);
|
|
127
114
|
}
|
|
128
|
-
}
|
|
129
|
-
const outgoingRequestString =
|
|
130
|
-
`${httpMethod.toUpperCase()} ${destinationUrl.href} HTTP/1.1\r\n` +
|
|
131
|
-
`Host: ${destinationUrl.host}\r\n` +
|
|
132
|
-
"Connection: close\r\n" +
|
|
133
|
-
postRequestStringContent +
|
|
134
|
-
"\r\n";
|
|
135
115
|
|
|
136
|
-
|
|
137
|
-
|
|
116
|
+
const fetchOptions: RequestInit = {
|
|
117
|
+
method: method,
|
|
118
|
+
headers: getFetchHeaders(options),
|
|
119
|
+
signal: controller.signal, // Enable cancellation via AbortController
|
|
120
|
+
};
|
|
138
121
|
|
|
139
|
-
if (
|
|
140
|
-
|
|
141
|
-
request.destroy();
|
|
142
|
-
reject(new Error("Request time out"));
|
|
143
|
-
});
|
|
122
|
+
if (method === HttpMethod.POST) {
|
|
123
|
+
fetchOptions.body = options?.body || "";
|
|
144
124
|
}
|
|
145
125
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
proxyStatusCode < ProxyStatus.SUCCESS_RANGE_START ||
|
|
154
|
-
proxyStatusCode > ProxyStatus.SUCCESS_RANGE_END
|
|
155
|
-
) {
|
|
156
|
-
request.destroy();
|
|
157
|
-
socket.destroy();
|
|
158
|
-
reject(
|
|
159
|
-
new Error(
|
|
160
|
-
`Error connecting to proxy. Http status code: ${
|
|
161
|
-
response.statusCode
|
|
162
|
-
}. Http status message: ${
|
|
163
|
-
response?.statusMessage || "Unknown"
|
|
164
|
-
}`
|
|
165
|
-
)
|
|
166
|
-
);
|
|
126
|
+
let response: Response;
|
|
127
|
+
try {
|
|
128
|
+
response = await fetch(url, fetchOptions);
|
|
129
|
+
} catch (error) {
|
|
130
|
+
// Clean up timeout to prevent memory leaks
|
|
131
|
+
if (timeoutId) {
|
|
132
|
+
clearTimeout(timeoutId);
|
|
167
133
|
}
|
|
168
134
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
socket.on("data", (chunk) => {
|
|
174
|
-
data.push(chunk);
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
socket.on("end", () => {
|
|
178
|
-
// combine all received buffer streams into one buffer, and then into a string
|
|
179
|
-
const dataString = Buffer.concat([...data]).toString();
|
|
180
|
-
|
|
181
|
-
// separate each line into it's own entry in an arry
|
|
182
|
-
const dataStringArray = dataString.split("\r\n");
|
|
183
|
-
// the first entry will contain the statusCode and statusMessage
|
|
184
|
-
const httpStatusCode = parseInt(
|
|
185
|
-
dataStringArray[0].split(" ")[1]
|
|
135
|
+
if (error instanceof Error && error.name === "AbortError") {
|
|
136
|
+
throw createAuthError(
|
|
137
|
+
ClientAuthErrorCodes.networkError,
|
|
138
|
+
"Request timeout"
|
|
186
139
|
);
|
|
187
|
-
|
|
188
|
-
const statusMessage = dataStringArray[0]
|
|
189
|
-
.split(" ")
|
|
190
|
-
.slice(2)
|
|
191
|
-
.join(" ");
|
|
192
|
-
// the last entry will contain the body
|
|
193
|
-
const body = dataStringArray[dataStringArray.length - 1];
|
|
194
|
-
|
|
195
|
-
// everything in between the first and last entries are the headers
|
|
196
|
-
const headersArray = dataStringArray.slice(
|
|
197
|
-
1,
|
|
198
|
-
dataStringArray.length - 2
|
|
199
|
-
);
|
|
200
|
-
|
|
201
|
-
// build an object out of all the headers
|
|
202
|
-
const entries = new Map();
|
|
203
|
-
headersArray.forEach((header) => {
|
|
204
|
-
/**
|
|
205
|
-
* the header might look like "Content-Length: 1531", but that is just a string
|
|
206
|
-
* it needs to be converted to a key/value pair
|
|
207
|
-
* split the string at the first instance of ":"
|
|
208
|
-
* there may be more than one ":" if the value of the header is supposed to be a JSON object
|
|
209
|
-
*/
|
|
210
|
-
const headerKeyValue = header.split(new RegExp(/:\s(.*)/s));
|
|
211
|
-
const headerKey = headerKeyValue[0];
|
|
212
|
-
let headerValue = headerKeyValue[1];
|
|
213
|
-
|
|
214
|
-
// check if the value of the header is supposed to be a JSON object
|
|
215
|
-
try {
|
|
216
|
-
const object = JSON.parse(headerValue);
|
|
217
|
-
|
|
218
|
-
// if it is, then convert it from a string to a JSON object
|
|
219
|
-
if (object && typeof object === "object") {
|
|
220
|
-
headerValue = object;
|
|
221
|
-
}
|
|
222
|
-
} catch (e) {
|
|
223
|
-
// otherwise, leave it as a string
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
entries.set(headerKey, headerValue);
|
|
227
|
-
});
|
|
228
|
-
const headers = Object.fromEntries(entries);
|
|
229
|
-
|
|
230
|
-
const parsedHeaders = headers as Record<string, string>;
|
|
231
|
-
const networkResponse = NetworkUtils.getNetworkResponse(
|
|
232
|
-
parsedHeaders,
|
|
233
|
-
parseBody(
|
|
234
|
-
httpStatusCode,
|
|
235
|
-
statusMessage,
|
|
236
|
-
parsedHeaders,
|
|
237
|
-
body
|
|
238
|
-
) as T,
|
|
239
|
-
httpStatusCode
|
|
240
|
-
);
|
|
241
|
-
|
|
242
|
-
if (
|
|
243
|
-
(httpStatusCode <
|
|
244
|
-
CommonConstants.HTTP_SUCCESS_RANGE_START ||
|
|
245
|
-
httpStatusCode >
|
|
246
|
-
CommonConstants.HTTP_SUCCESS_RANGE_END) &&
|
|
247
|
-
// do not destroy the request for the device code flow
|
|
248
|
-
networkResponse.body["error"] !==
|
|
249
|
-
Constants.AUTHORIZATION_PENDING
|
|
250
|
-
) {
|
|
251
|
-
request.destroy();
|
|
252
|
-
}
|
|
253
|
-
resolve(networkResponse);
|
|
254
|
-
});
|
|
255
|
-
|
|
256
|
-
socket.on("error", (chunk) => {
|
|
257
|
-
request.destroy();
|
|
258
|
-
socket.destroy();
|
|
259
|
-
reject(new Error(chunk.toString()));
|
|
260
|
-
});
|
|
261
|
-
});
|
|
262
|
-
|
|
263
|
-
request.on("error", (chunk) => {
|
|
264
|
-
request.destroy();
|
|
265
|
-
reject(new Error(chunk.toString()));
|
|
266
|
-
});
|
|
267
|
-
});
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
const networkRequestViaHttps = <T>(
|
|
271
|
-
urlString: string,
|
|
272
|
-
httpMethod: string,
|
|
273
|
-
options?: NetworkRequestOptions,
|
|
274
|
-
agentOptions?: https.AgentOptions,
|
|
275
|
-
timeout?: number
|
|
276
|
-
): Promise<NetworkResponse<T>> => {
|
|
277
|
-
const isPostRequest = httpMethod === HttpMethod.POST;
|
|
278
|
-
const body: string = options?.body || "";
|
|
279
|
-
|
|
280
|
-
const url = new URL(urlString);
|
|
281
|
-
const headers = options?.headers || ({} as Record<string, string>);
|
|
282
|
-
const customOptions: https.RequestOptions = {
|
|
283
|
-
method: httpMethod,
|
|
284
|
-
headers: headers,
|
|
285
|
-
...NetworkUtils.urlToHttpOptions(url),
|
|
286
|
-
};
|
|
287
|
-
|
|
288
|
-
if (agentOptions && Object.keys(agentOptions).length) {
|
|
289
|
-
customOptions.agent = new https.Agent(agentOptions);
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
if (isPostRequest) {
|
|
293
|
-
// needed for post request to work
|
|
294
|
-
customOptions.headers = {
|
|
295
|
-
...customOptions.headers,
|
|
296
|
-
"Content-Length": body.length,
|
|
297
|
-
};
|
|
298
|
-
} else {
|
|
299
|
-
// optional timeout is only for get requests (regionDiscovery, for example)
|
|
300
|
-
if (timeout) {
|
|
301
|
-
customOptions.timeout = timeout;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
140
|
+
}
|
|
304
141
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
142
|
+
const baseAuthError: AuthError = createAuthError(
|
|
143
|
+
ClientAuthErrorCodes.networkError,
|
|
144
|
+
`Network request failed: ${
|
|
145
|
+
error instanceof Error ? error.message : "unknown"
|
|
146
|
+
}`
|
|
147
|
+
);
|
|
148
|
+
throw createNetworkError(
|
|
149
|
+
baseAuthError,
|
|
150
|
+
undefined,
|
|
151
|
+
undefined,
|
|
152
|
+
error instanceof Error ? error : undefined
|
|
153
|
+
);
|
|
312
154
|
}
|
|
313
155
|
|
|
314
|
-
|
|
315
|
-
|
|
156
|
+
// Clean up timeout to prevent memory leaks
|
|
157
|
+
if (timeoutId) {
|
|
158
|
+
clearTimeout(timeoutId);
|
|
316
159
|
}
|
|
317
160
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
161
|
+
try {
|
|
162
|
+
return {
|
|
163
|
+
headers: getHeaderDict(response.headers),
|
|
164
|
+
body: (await response.json()) as T,
|
|
165
|
+
status: response.status,
|
|
166
|
+
};
|
|
167
|
+
} catch (error) {
|
|
168
|
+
throw createAuthError(
|
|
169
|
+
ClientAuthErrorCodes.tokenParsingError,
|
|
170
|
+
`Failed to parse response: ${
|
|
171
|
+
error instanceof Error ? error.message : "unknown"
|
|
172
|
+
}`
|
|
173
|
+
);
|
|
323
174
|
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
324
177
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
response.on("end", () => {
|
|
338
|
-
// combine all received buffer streams into one buffer, and then into a string
|
|
339
|
-
const body = Buffer.concat([...data]).toString();
|
|
340
|
-
|
|
341
|
-
const parsedHeaders = headers as Record<string, string>;
|
|
342
|
-
const networkResponse = NetworkUtils.getNetworkResponse(
|
|
343
|
-
parsedHeaders,
|
|
344
|
-
parseBody(
|
|
345
|
-
statusCode,
|
|
346
|
-
statusMessage,
|
|
347
|
-
parsedHeaders,
|
|
348
|
-
body
|
|
349
|
-
) as T,
|
|
350
|
-
statusCode
|
|
351
|
-
);
|
|
352
|
-
|
|
353
|
-
if (
|
|
354
|
-
(statusCode < CommonConstants.HTTP_SUCCESS_RANGE_START ||
|
|
355
|
-
statusCode > CommonConstants.HTTP_SUCCESS_RANGE_END) &&
|
|
356
|
-
// do not destroy the request for the device code flow
|
|
357
|
-
networkResponse.body["error"] !==
|
|
358
|
-
Constants.AUTHORIZATION_PENDING
|
|
359
|
-
) {
|
|
360
|
-
request.destroy();
|
|
361
|
-
}
|
|
362
|
-
resolve(networkResponse);
|
|
363
|
-
});
|
|
364
|
-
});
|
|
178
|
+
/**
|
|
179
|
+
* Converts a fetch Headers object to a plain JavaScript object.
|
|
180
|
+
*
|
|
181
|
+
* The fetch API returns headers as a Headers object with methods like get(), has(),
|
|
182
|
+
* etc. However, the rest of the MSAL codebase expects headers as a simple key-value
|
|
183
|
+
* object. This function performs that conversion.
|
|
184
|
+
*
|
|
185
|
+
* @param headers - The Headers object returned by fetch response
|
|
186
|
+
* @returns A plain object with header names as keys and values as strings
|
|
187
|
+
*/
|
|
188
|
+
function getHeaderDict(headers: Headers): Record<string, string> {
|
|
189
|
+
const headerDict: Record<string, string> = {};
|
|
365
190
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
reject(new Error(chunk.toString()));
|
|
369
|
-
});
|
|
191
|
+
headers.forEach((value: string, key: string) => {
|
|
192
|
+
headerDict[key] = value;
|
|
370
193
|
});
|
|
371
|
-
|
|
194
|
+
|
|
195
|
+
return headerDict;
|
|
196
|
+
}
|
|
372
197
|
|
|
373
198
|
/**
|
|
374
|
-
*
|
|
375
|
-
*
|
|
376
|
-
*
|
|
377
|
-
*
|
|
378
|
-
*
|
|
379
|
-
*
|
|
199
|
+
* Converts NetworkRequestOptions headers to a fetch-compatible Headers object.
|
|
200
|
+
*
|
|
201
|
+
* The MSAL library uses plain objects for headers in NetworkRequestOptions,
|
|
202
|
+
* but the fetch API expects either a Headers object, plain object, or array
|
|
203
|
+
* of arrays. Using the Headers constructor provides better compatibility
|
|
204
|
+
* and validation.
|
|
205
|
+
*
|
|
206
|
+
* @param options - Optional NetworkRequestOptions containing headers
|
|
207
|
+
* @returns A Headers object ready for use with fetch API
|
|
380
208
|
*/
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
statusMessage: string | undefined,
|
|
384
|
-
headers: Record<string, string>,
|
|
385
|
-
body: string
|
|
386
|
-
) => {
|
|
387
|
-
/*
|
|
388
|
-
* Informational responses (100 – 199)
|
|
389
|
-
* Successful responses (200 – 299)
|
|
390
|
-
* Redirection messages (300 – 399)
|
|
391
|
-
* Client error responses (400 – 499)
|
|
392
|
-
* Server error responses (500 – 599)
|
|
393
|
-
*/
|
|
394
|
-
|
|
395
|
-
let parsedBody;
|
|
396
|
-
try {
|
|
397
|
-
parsedBody = JSON.parse(body);
|
|
398
|
-
} catch (error) {
|
|
399
|
-
let errorType;
|
|
400
|
-
let errorDescriptionHelper;
|
|
401
|
-
if (
|
|
402
|
-
statusCode >= CommonConstants.HTTP_CLIENT_ERROR_RANGE_START &&
|
|
403
|
-
statusCode <= CommonConstants.HTTP_CLIENT_ERROR_RANGE_END
|
|
404
|
-
) {
|
|
405
|
-
errorType = "client_error";
|
|
406
|
-
errorDescriptionHelper = "A client";
|
|
407
|
-
} else if (
|
|
408
|
-
statusCode >= CommonConstants.HTTP_SERVER_ERROR_RANGE_START &&
|
|
409
|
-
statusCode <= CommonConstants.HTTP_SERVER_ERROR_RANGE_END
|
|
410
|
-
) {
|
|
411
|
-
errorType = "server_error";
|
|
412
|
-
errorDescriptionHelper = "A server";
|
|
413
|
-
} else {
|
|
414
|
-
errorType = "unknown_error";
|
|
415
|
-
errorDescriptionHelper = "An unknown";
|
|
416
|
-
}
|
|
209
|
+
function getFetchHeaders(options?: NetworkRequestOptions): Headers {
|
|
210
|
+
const headers = new Headers();
|
|
417
211
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
error_description: `${errorDescriptionHelper} error occured.\nHttp status code: ${statusCode}\nHttp status message: ${
|
|
421
|
-
statusMessage || "Unknown"
|
|
422
|
-
}\nHeaders: ${JSON.stringify(headers)}`,
|
|
423
|
-
};
|
|
212
|
+
if (!(options && options.headers)) {
|
|
213
|
+
return headers;
|
|
424
214
|
}
|
|
425
215
|
|
|
426
|
-
|
|
427
|
-
|
|
216
|
+
Object.entries(options.headers).forEach(([key, value]) => {
|
|
217
|
+
headers.append(key, value);
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
return headers;
|
|
221
|
+
}
|
package/src/packageMetadata.ts
CHANGED
|
@@ -13,7 +13,8 @@ import { CommonAuthorizationCodeRequest } from "@azure/msal-common/node";
|
|
|
13
13
|
* - authority: - URL of the authority, the security token service (STS) from which MSAL will acquire tokens. If authority is set on client application object, this will override that value. Overriding the value will cause for authority validation to happen each time. If the same authority will be used for all request, set on the application object instead of the requests.
|
|
14
14
|
* - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
|
|
15
15
|
* - redirectUri - The redirect URI of your app, where the authority will redirect to after the user inputs credentials and consents. It must exactly match one of the redirect URIs you registered in the portal.
|
|
16
|
-
* -
|
|
16
|
+
* - extraQueryParameters - String to string map of custom query parameters added to outgoing token service requests
|
|
17
|
+
* - extraParameters - String to string map of custom query parameters added to outgoing token service requests
|
|
17
18
|
* - code - The authorization_code that the user acquired in the first leg of the flow.
|
|
18
19
|
* - codeVerifier - The same code_verifier that was used to obtain the authorization_code. Required if PKCE was used in the authorization code grant request.For more information, see the PKCE RFC: https://tools.ietf.org/html/rfc7636
|
|
19
20
|
* - state - Unique GUID generated by the user that is cached by the user and sent to the server during the first leg of the flow. This string is sent back by the server with the authorization code. The user cached state is then compared with the state received from the server to mitigate the risk of CSRF attacks. See https://datatracker.ietf.org/doc/html/rfc6819#section-3.6.
|
|
@@ -28,8 +28,8 @@ import { CommonAuthorizationUrlRequest } from "@azure/msal-common/node";
|
|
|
28
28
|
* - loginHint - Can be used to pre-fill the username/email address field of the sign-in page for the user, if you know the username/email address ahead of time. Often apps use this parameter during re-authentication, having already extracted the username from a previous sign-in using the preferred_username claim.
|
|
29
29
|
* - sid - Session ID, unique identifier for the session. Available as an optional claim on ID tokens.
|
|
30
30
|
* - domainHint - Provides a hint about the tenant or domain that the user should use to sign in. The value of the domain hint is a registered domain for the tenant.
|
|
31
|
-
* - extraQueryParameters - String to string map of custom query parameters added to
|
|
32
|
-
* -
|
|
31
|
+
* - extraQueryParameters - String to string map of custom query parameters added to outgoing token service requests
|
|
32
|
+
* - extraParameters - String to string map of custom query parameters added to outgoing token service requests
|
|
33
33
|
* - nonce - A value included in the request that is returned in the id token. A randomly generated unique value is typically used to mitigate replay attacks.
|
|
34
34
|
* @public
|
|
35
35
|
*/
|
|
@@ -13,7 +13,6 @@ import { CommonClientCredentialRequest } from "./CommonClientCredentialRequest.j
|
|
|
13
13
|
* - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
|
|
14
14
|
* - skipCache - Skip token cache lookup and force request to authority to get a a new token. Defaults to false.
|
|
15
15
|
* - clientAssertion - An assertion string or a callback function that returns an assertion string (both are Base64Url-encoded signed JWTs) used in the Client Credential flow
|
|
16
|
-
* - tokenQueryParameters - String to string map of custom query parameters added to the /token call
|
|
17
16
|
* @public
|
|
18
17
|
*/
|
|
19
18
|
export type ClientCredentialRequest = Partial<
|
|
@@ -16,9 +16,13 @@ import {
|
|
|
16
16
|
* - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
|
|
17
17
|
* - skipCache - Skip token cache lookup and force request to authority to get a a new token. Defaults to false.
|
|
18
18
|
* - preferredAzureRegionOptions - Options of the user's preferred azure region
|
|
19
|
-
* -
|
|
19
|
+
* - clientAssertion - An assertion string or a callback function that returns an assertion string (both are Base64Url-encoded signed JWTs) used in the Client Credential flow
|
|
20
|
+
* - azureRegion - Azure region to be used for regional authentication
|
|
20
21
|
*/
|
|
21
|
-
export type CommonClientCredentialRequest =
|
|
22
|
+
export type CommonClientCredentialRequest = Omit<
|
|
23
|
+
BaseAuthRequest,
|
|
24
|
+
"extraQueryParameters" | "extraParameters"
|
|
25
|
+
> & {
|
|
22
26
|
skipCache?: boolean;
|
|
23
27
|
azureRegion?: AzureRegion;
|
|
24
28
|
clientAssertion?: ClientAssertion;
|