@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
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
AuthenticationResult,
|
|
12
12
|
Authority,
|
|
13
13
|
AuthToken,
|
|
14
|
-
BaseClient,
|
|
15
14
|
ClientAuthErrorCodes,
|
|
16
15
|
ClientConfiguration,
|
|
17
16
|
createClientAuthError,
|
|
@@ -28,10 +27,10 @@ import {
|
|
|
28
27
|
ClientAssertion,
|
|
29
28
|
getClientAssertion,
|
|
30
29
|
UrlUtils,
|
|
31
|
-
StubPerformanceClient,
|
|
32
30
|
} from "@azure/msal-common/node";
|
|
33
31
|
import { EncodingUtils } from "../utils/EncodingUtils.js";
|
|
34
32
|
import { CommonOnBehalfOfRequest } from "../request/CommonOnBehalfOfRequest.js";
|
|
33
|
+
import { BaseClient } from "./BaseClient.js";
|
|
35
34
|
|
|
36
35
|
/**
|
|
37
36
|
* On-Behalf-Of client
|
|
@@ -42,7 +41,7 @@ export class OnBehalfOfClient extends BaseClient {
|
|
|
42
41
|
private userAssertionHash: string;
|
|
43
42
|
|
|
44
43
|
constructor(configuration: ClientConfiguration) {
|
|
45
|
-
super(configuration
|
|
44
|
+
super(configuration);
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
/**
|
|
@@ -161,12 +161,12 @@ export class PublicClientApplication
|
|
|
161
161
|
...remainingProperties,
|
|
162
162
|
clientId: this.config.auth.clientId,
|
|
163
163
|
scopes: request.scopes || CommonConstants.OIDC_DEFAULT_SCOPES,
|
|
164
|
-
redirectUri:
|
|
164
|
+
redirectUri: request.redirectUri || "",
|
|
165
165
|
authority: request.authority || this.config.auth.authority,
|
|
166
166
|
correlationId: correlationId,
|
|
167
167
|
extraParameters: {
|
|
168
168
|
...remainingProperties.extraQueryParameters,
|
|
169
|
-
...remainingProperties.
|
|
169
|
+
...remainingProperties.extraParameters,
|
|
170
170
|
[AADServerParamKeys.X_CLIENT_EXTRA_SKU]: this.skus,
|
|
171
171
|
},
|
|
172
172
|
accountId: remainingProperties.account?.nativeAccountId,
|
|
@@ -177,6 +177,15 @@ export class PublicClientApplication
|
|
|
177
177
|
);
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
+
if (request.redirectUri) {
|
|
181
|
+
// If it's not a broker fallback scenario, we throw an error
|
|
182
|
+
if (!this.config.broker.nativeBrokerPlugin) {
|
|
183
|
+
throw NodeAuthError.createRedirectUriNotSupportedError();
|
|
184
|
+
}
|
|
185
|
+
// If a redirect URI is provided for a broker flow but MSAL runtime startup failed, we fall back to the browser flow and will ignore the redirect URI provided for the broker flow
|
|
186
|
+
request.redirectUri = "";
|
|
187
|
+
}
|
|
188
|
+
|
|
180
189
|
const { verifier, challenge } =
|
|
181
190
|
await this.cryptoProvider.generatePkceCodes();
|
|
182
191
|
|
|
@@ -257,11 +266,12 @@ export class PublicClientApplication
|
|
|
257
266
|
...request,
|
|
258
267
|
clientId: this.config.auth.clientId,
|
|
259
268
|
scopes: request.scopes || CommonConstants.OIDC_DEFAULT_SCOPES,
|
|
260
|
-
redirectUri:
|
|
269
|
+
redirectUri: request.redirectUri || "",
|
|
261
270
|
authority: request.authority || this.config.auth.authority,
|
|
262
271
|
correlationId: correlationId,
|
|
263
272
|
extraParameters: {
|
|
264
|
-
...request.
|
|
273
|
+
...request.extraQueryParameters,
|
|
274
|
+
...request.extraParameters,
|
|
265
275
|
[AADServerParamKeys.X_CLIENT_EXTRA_SKU]: this.skus,
|
|
266
276
|
},
|
|
267
277
|
accountId: request.account.nativeAccountId,
|
|
@@ -270,6 +280,14 @@ export class PublicClientApplication
|
|
|
270
280
|
return this.nativeBrokerPlugin.acquireTokenSilent(brokerRequest);
|
|
271
281
|
}
|
|
272
282
|
|
|
283
|
+
if (request.redirectUri) {
|
|
284
|
+
// If it's not a broker fallback scenario, we throw an error
|
|
285
|
+
if (!this.config.broker.nativeBrokerPlugin) {
|
|
286
|
+
throw NodeAuthError.createRedirectUriNotSupportedError();
|
|
287
|
+
}
|
|
288
|
+
request.redirectUri = "";
|
|
289
|
+
}
|
|
290
|
+
|
|
273
291
|
return super.acquireTokenSilent(request);
|
|
274
292
|
}
|
|
275
293
|
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
import {
|
|
7
7
|
AuthenticationResult,
|
|
8
8
|
Authority,
|
|
9
|
-
BaseClient,
|
|
10
9
|
CcsCredentialType,
|
|
11
10
|
ClientAssertion,
|
|
12
11
|
ClientConfiguration,
|
|
@@ -21,9 +20,9 @@ import {
|
|
|
21
20
|
UrlString,
|
|
22
21
|
UrlUtils,
|
|
23
22
|
getClientAssertion,
|
|
24
|
-
StubPerformanceClient,
|
|
25
23
|
} from "@azure/msal-common/node";
|
|
26
24
|
import { CommonUsernamePasswordRequest } from "../request/CommonUsernamePasswordRequest.js";
|
|
25
|
+
import { BaseClient } from "./BaseClient.js";
|
|
27
26
|
|
|
28
27
|
/**
|
|
29
28
|
* Oauth2.0 Password grant client
|
|
@@ -33,7 +32,7 @@ import { CommonUsernamePasswordRequest } from "../request/CommonUsernamePassword
|
|
|
33
32
|
*/
|
|
34
33
|
export class UsernamePasswordClient extends BaseClient {
|
|
35
34
|
constructor(configuration: ClientConfiguration) {
|
|
36
|
-
super(configuration
|
|
35
|
+
super(configuration);
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
/**
|
|
@@ -17,8 +17,6 @@ import {
|
|
|
17
17
|
Constants,
|
|
18
18
|
} from "@azure/msal-common/node";
|
|
19
19
|
import { HttpClient } from "../network/HttpClient.js";
|
|
20
|
-
import http from "http";
|
|
21
|
-
import https from "https";
|
|
22
20
|
import { ManagedIdentityId } from "./ManagedIdentityId.js";
|
|
23
21
|
import { NodeAuthError } from "../error/NodeAuthError.js";
|
|
24
22
|
|
|
@@ -85,8 +83,6 @@ export type BrokerOptions = {
|
|
|
85
83
|
export type NodeSystemOptions = {
|
|
86
84
|
loggerOptions?: LoggerOptions;
|
|
87
85
|
networkClient?: INetworkModule;
|
|
88
|
-
proxyUrl?: string;
|
|
89
|
-
customAgentOptions?: http.AgentOptions | https.AgentOptions;
|
|
90
86
|
disableInternalRetries?: boolean;
|
|
91
87
|
protocolMode?: ProtocolMode;
|
|
92
88
|
};
|
|
@@ -160,8 +156,6 @@ const DEFAULT_LOGGER_OPTIONS: LoggerOptions = {
|
|
|
160
156
|
const DEFAULT_SYSTEM_OPTIONS: Required<NodeSystemOptions> = {
|
|
161
157
|
loggerOptions: DEFAULT_LOGGER_OPTIONS,
|
|
162
158
|
networkClient: new HttpClient(),
|
|
163
|
-
proxyUrl: "",
|
|
164
|
-
customAgentOptions: {} as http.AgentOptions | https.AgentOptions,
|
|
165
159
|
disableInternalRetries: false,
|
|
166
160
|
protocolMode: ProtocolMode.AAD,
|
|
167
161
|
};
|
|
@@ -202,10 +196,7 @@ export function buildAppConfiguration({
|
|
|
202
196
|
}: Configuration): NodeConfiguration {
|
|
203
197
|
const systemOptions: Required<NodeSystemOptions> = {
|
|
204
198
|
...DEFAULT_SYSTEM_OPTIONS,
|
|
205
|
-
networkClient: new HttpClient(
|
|
206
|
-
system?.proxyUrl,
|
|
207
|
-
system?.customAgentOptions as http.AgentOptions | https.AgentOptions
|
|
208
|
-
),
|
|
199
|
+
networkClient: new HttpClient(),
|
|
209
200
|
loggerOptions: system?.loggerOptions || DEFAULT_LOGGER_OPTIONS,
|
|
210
201
|
disableInternalRetries: system?.disableInternalRetries || false,
|
|
211
202
|
};
|
|
@@ -256,10 +247,7 @@ export function buildManagedIdentityConfiguration({
|
|
|
256
247
|
networkClient = system.networkClient;
|
|
257
248
|
// otherwise, create a new one
|
|
258
249
|
} else {
|
|
259
|
-
networkClient = new HttpClient(
|
|
260
|
-
system?.proxyUrl,
|
|
261
|
-
system?.customAgentOptions as http.AgentOptions | https.AgentOptions
|
|
262
|
-
);
|
|
250
|
+
networkClient = new HttpClient();
|
|
263
251
|
}
|
|
264
252
|
|
|
265
253
|
return {
|
|
@@ -38,7 +38,7 @@ export class ManagedIdentityRequestParameters {
|
|
|
38
38
|
const parameters = new Map<string, string>();
|
|
39
39
|
|
|
40
40
|
if (this.queryParameters) {
|
|
41
|
-
RequestParameterBuilder.
|
|
41
|
+
RequestParameterBuilder.addExtraParameters(
|
|
42
42
|
parameters,
|
|
43
43
|
this.queryParameters
|
|
44
44
|
);
|
|
@@ -56,7 +56,7 @@ export class ManagedIdentityRequestParameters {
|
|
|
56
56
|
const parameters = new Map<string, string>();
|
|
57
57
|
|
|
58
58
|
if (this.bodyParameters) {
|
|
59
|
-
RequestParameterBuilder.
|
|
59
|
+
RequestParameterBuilder.addExtraParameters(
|
|
60
60
|
parameters,
|
|
61
61
|
this.bodyParameters
|
|
62
62
|
);
|
|
@@ -41,6 +41,10 @@ export const NodeAuthErrorMessage = {
|
|
|
41
41
|
code: "thumbprint_missing_from_client_certificate",
|
|
42
42
|
desc: "Client certificate does not contain a SHA-1 or SHA-256 thumbprint.",
|
|
43
43
|
},
|
|
44
|
+
redirectUriNotSupported: {
|
|
45
|
+
code: "redirect_uri_not_supported",
|
|
46
|
+
desc: "RedirectUri is not supported in this scenario. Please remove redirectUri from the request.",
|
|
47
|
+
},
|
|
44
48
|
};
|
|
45
49
|
|
|
46
50
|
export class NodeAuthError extends AuthError {
|
|
@@ -128,4 +132,14 @@ export class NodeAuthError extends AuthError {
|
|
|
128
132
|
NodeAuthErrorMessage.thumbprintMissing.desc
|
|
129
133
|
);
|
|
130
134
|
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Creates an error thrown when redirectUri is provided in an unsupported scenario
|
|
138
|
+
*/
|
|
139
|
+
static createRedirectUriNotSupportedError(): NodeAuthError {
|
|
140
|
+
return new NodeAuthError(
|
|
141
|
+
NodeAuthErrorMessage.redirectUriNotSupported.code,
|
|
142
|
+
NodeAuthErrorMessage.redirectUriNotSupported.desc
|
|
143
|
+
);
|
|
144
|
+
}
|
|
131
145
|
}
|
package/src/index.ts
CHANGED
|
@@ -27,12 +27,7 @@ export { ILoopbackClient } from "./network/ILoopbackClient.js";
|
|
|
27
27
|
// Clients and Configuration
|
|
28
28
|
export { PublicClientApplication } from "./client/PublicClientApplication.js";
|
|
29
29
|
export { ConfidentialClientApplication } from "./client/ConfidentialClientApplication.js";
|
|
30
|
-
export { ClientApplication } from "./client/ClientApplication.js";
|
|
31
|
-
export { ClientCredentialClient } from "./client/ClientCredentialClient.js";
|
|
32
|
-
export { DeviceCodeClient } from "./client/DeviceCodeClient.js";
|
|
33
|
-
export { OnBehalfOfClient } from "./client/OnBehalfOfClient.js";
|
|
34
30
|
export { ManagedIdentityApplication } from "./client/ManagedIdentityApplication.js";
|
|
35
|
-
export { UsernamePasswordClient } from "./client/UsernamePasswordClient.js";
|
|
36
31
|
|
|
37
32
|
export {
|
|
38
33
|
Configuration,
|
|
@@ -63,9 +58,6 @@ export { DistributedCachePlugin } from "./cache/distributed/DistributedCachePlug
|
|
|
63
58
|
// Constants
|
|
64
59
|
export { ManagedIdentitySourceNames } from "./utils/Constants.js";
|
|
65
60
|
|
|
66
|
-
// Crypto
|
|
67
|
-
export { CryptoProvider } from "./crypto/CryptoProvider.js";
|
|
68
|
-
|
|
69
61
|
// Request objects
|
|
70
62
|
export type { AuthorizationCodeRequest } from "./request/AuthorizationCodeRequest.js";
|
|
71
63
|
export type { AuthorizationUrlRequest } from "./request/AuthorizationUrlRequest.js";
|