@azure/msal-node 3.3.0 → 3.4.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/NodeStorage.mjs +1 -1
- package/dist/cache/TokenCache.mjs +1 -1
- package/dist/cache/distributed/DistributedCachePlugin.mjs +1 -1
- package/dist/cache/serializer/Deserializer.mjs +1 -1
- package/dist/cache/serializer/Serializer.mjs +1 -1
- package/dist/client/ClientApplication.d.ts +3 -3
- package/dist/client/ClientApplication.d.ts.map +1 -1
- package/dist/client/ClientApplication.mjs +14 -17
- package/dist/client/ClientApplication.mjs.map +1 -1
- package/dist/client/ClientAssertion.mjs +1 -1
- package/dist/client/ClientCredentialClient.d.ts.map +1 -1
- package/dist/client/ClientCredentialClient.mjs +16 -16
- package/dist/client/ClientCredentialClient.mjs.map +1 -1
- package/dist/client/ConfidentialClientApplication.d.ts.map +1 -1
- package/dist/client/ConfidentialClientApplication.mjs +5 -3
- package/dist/client/ConfidentialClientApplication.mjs.map +1 -1
- package/dist/client/DeviceCodeClient.d.ts.map +1 -1
- package/dist/client/DeviceCodeClient.mjs +24 -24
- package/dist/client/DeviceCodeClient.mjs.map +1 -1
- package/dist/client/ManagedIdentityApplication.mjs +1 -1
- package/dist/client/ManagedIdentityClient.mjs +1 -1
- package/dist/client/ManagedIdentitySources/AppService.mjs +1 -1
- package/dist/client/ManagedIdentitySources/AzureArc.mjs +1 -1
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +1 -1
- package/dist/client/ManagedIdentitySources/CloudShell.mjs +1 -1
- package/dist/client/ManagedIdentitySources/Imds.mjs +1 -1
- package/dist/client/ManagedIdentitySources/MachineLearning.mjs +1 -1
- package/dist/client/ManagedIdentitySources/ServiceFabric.mjs +1 -1
- package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
- package/dist/client/OnBehalfOfClient.mjs +19 -19
- package/dist/client/OnBehalfOfClient.mjs.map +1 -1
- package/dist/client/PublicClientApplication.d.ts.map +1 -1
- package/dist/client/PublicClientApplication.mjs +3 -2
- package/dist/client/PublicClientApplication.mjs.map +1 -1
- package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
- package/dist/client/UsernamePasswordClient.mjs +21 -21
- package/dist/client/UsernamePasswordClient.mjs.map +1 -1
- package/dist/config/Configuration.mjs +1 -1
- package/dist/config/ManagedIdentityId.mjs +1 -1
- package/dist/config/ManagedIdentityRequestParameters.d.ts.map +1 -1
- package/dist/config/ManagedIdentityRequestParameters.mjs +8 -8
- package/dist/config/ManagedIdentityRequestParameters.mjs.map +1 -1
- package/dist/crypto/CryptoProvider.mjs +1 -1
- package/dist/crypto/GuidGenerator.mjs +1 -1
- package/dist/crypto/HashUtils.mjs +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/error/ManagedIdentityError.mjs +1 -1
- package/dist/error/ManagedIdentityErrorCodes.mjs +1 -1
- package/dist/error/NodeAuthError.mjs +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/internals.mjs +1 -1
- package/dist/network/HttpClient.mjs +1 -1
- package/dist/network/HttpClientWithRetries.mjs +1 -1
- package/dist/network/ILoopbackClient.d.ts +2 -2
- package/dist/network/ILoopbackClient.d.ts.map +1 -1
- package/dist/network/LoopbackClient.d.ts +2 -2
- package/dist/network/LoopbackClient.d.ts.map +1 -1
- package/dist/network/LoopbackClient.mjs +3 -2
- package/dist/network/LoopbackClient.mjs.map +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/protocol/Authorize.d.ts +12 -0
- package/dist/protocol/Authorize.d.ts.map +1 -0
- package/dist/protocol/Authorize.mjs +42 -0
- package/dist/protocol/Authorize.mjs.map +1 -0
- package/dist/retry/LinearRetryPolicy.mjs +1 -1
- package/dist/utils/Constants.mjs +1 -1
- package/dist/utils/EncodingUtils.mjs +1 -1
- package/dist/utils/NetworkUtils.mjs +1 -1
- package/dist/utils/TimeUtils.mjs +1 -1
- package/lib/msal-node.cjs +834 -917
- package/lib/msal-node.cjs.map +1 -1
- package/lib/types/client/ClientApplication.d.ts +3 -3
- package/lib/types/client/ClientApplication.d.ts.map +1 -1
- package/lib/types/client/ClientCredentialClient.d.ts.map +1 -1
- package/lib/types/client/ConfidentialClientApplication.d.ts.map +1 -1
- package/lib/types/client/DeviceCodeClient.d.ts.map +1 -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.map +1 -1
- package/lib/types/config/ManagedIdentityRequestParameters.d.ts.map +1 -1
- package/lib/types/index.d.ts +5 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/network/ILoopbackClient.d.ts +2 -2
- package/lib/types/network/ILoopbackClient.d.ts.map +1 -1
- package/lib/types/network/LoopbackClient.d.ts +2 -2
- package/lib/types/network/LoopbackClient.d.ts.map +1 -1
- package/lib/types/packageMetadata.d.ts +1 -1
- package/lib/types/protocol/Authorize.d.ts +12 -0
- package/lib/types/protocol/Authorize.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/client/ClientApplication.ts +42 -44
- package/src/client/ClientCredentialClient.ts +32 -14
- package/src/client/ConfidentialClientApplication.ts +15 -7
- package/src/client/DeviceCodeClient.ts +46 -24
- package/src/client/OnBehalfOfClient.ts +38 -17
- package/src/client/PublicClientApplication.ts +9 -5
- package/src/client/UsernamePasswordClient.ts +37 -19
- package/src/config/ManagedIdentityRequestParameters.ts +17 -7
- package/src/index.ts +5 -2
- package/src/network/ILoopbackClient.ts +2 -2
- package/src/network/LoopbackClient.ts +43 -46
- package/src/packageMetadata.ts +1 -1
- package/src/protocol/Authorize.ts +63 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClientConfiguration, AuthenticationResult, BaseAuthRequest, Logger, ServerTelemetryManager, AzureRegionConfiguration, AzureCloudOptions, AuthorizationCodePayload, ClientAssertionCallback } from "@azure/msal-common/node";
|
|
1
|
+
import { ClientConfiguration, AuthenticationResult, Authority, BaseAuthRequest, Logger, ServerTelemetryManager, AzureRegionConfiguration, AzureCloudOptions, AuthorizationCodePayload, ClientAssertionCallback } from "@azure/msal-common/node";
|
|
2
2
|
import { Configuration, NodeConfiguration } from "../config/Configuration.js";
|
|
3
3
|
import { CryptoProvider } from "../crypto/CryptoProvider.js";
|
|
4
4
|
import { NodeStorage } from "../cache/NodeStorage.js";
|
|
@@ -118,7 +118,7 @@ export declare abstract class ClientApplication {
|
|
|
118
118
|
* @param authority - user passed authority in configuration
|
|
119
119
|
* @param serverTelemetryManager - initializes servertelemetry if passed
|
|
120
120
|
*/
|
|
121
|
-
protected buildOauthClientConfiguration(
|
|
121
|
+
protected buildOauthClientConfiguration(discoveredAuthority: Authority, requestCorrelationId: string, redirectUri: string, serverTelemetryManager?: ServerTelemetryManager): Promise<ClientConfiguration>;
|
|
122
122
|
private getClientAssertion;
|
|
123
123
|
/**
|
|
124
124
|
* Generates a request with the default scopes & generates a correlationId.
|
|
@@ -137,7 +137,7 @@ export declare abstract class ClientApplication {
|
|
|
137
137
|
* object. If no authority set in application object, then default to common authority.
|
|
138
138
|
* @param authorityString - authority from user configuration
|
|
139
139
|
*/
|
|
140
|
-
|
|
140
|
+
protected createAuthority(authorityString: string, requestCorrelationId: string, azureRegionConfiguration?: AzureRegionConfiguration, azureCloudOptions?: AzureCloudOptions): Promise<Authority>;
|
|
141
141
|
/**
|
|
142
142
|
* Clear the cache
|
|
143
143
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientApplication.d.ts","sourceRoot":"","sources":["../../../src/client/ClientApplication.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,mBAAmB,EAEnB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"ClientApplication.d.ts","sourceRoot":"","sources":["../../../src/client/ClientApplication.ts"],"names":[],"mappings":"AAKA,OAA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eAAe,EAAE,MAAM,EACvB,oBAAoB,EAAE,MAAM,EAC5B,wBAAwB,CAAC,EAAE,wBAAwB,EACnD,iBAAiB,CAAC,EAAE,iBAAiB,GACtC,OAAO,CAAC,SAAS,CAAC;IA6BrB;;OAEG;IACH,UAAU,IAAI,IAAI;CAGrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientCredentialClient.d.ts","sourceRoot":"","sources":["../../../src/client/ClientCredentialClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,oBAAoB,EAEpB,SAAS,EACT,UAAU,EACV,YAAY,EACZ,YAAY,EAEZ,mBAAmB,EACnB,6BAA6B,EAM7B,iBAAiB,EACjB,OAAO,EAMP,sBAAsB,
|
|
1
|
+
{"version":3,"file":"ClientCredentialClient.d.ts","sourceRoot":"","sources":["../../../src/client/ClientCredentialClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,oBAAoB,EAEpB,SAAS,EACT,UAAU,EACV,YAAY,EACZ,YAAY,EAEZ,mBAAmB,EACnB,6BAA6B,EAM7B,iBAAiB,EACjB,OAAO,EAMP,sBAAsB,EASzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACH,4BAA4B,EAE/B,MAAM,4BAA4B,CAAC;AAEpC;;;GAGG;AACH,qBAAa,sBAAuB,SAAQ,UAAU;IAClD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAoB;gBAGlD,aAAa,EAAE,mBAAmB,EAClC,gBAAgB,CAAC,EAAE,iBAAiB;IAMxC;;;OAGG;IACU,YAAY,CACrB,OAAO,EAAE,6BAA6B,GACvC,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAsCvC;;OAEG;IACU,6BAA6B,CACtC,OAAO,EAAE,6BAA6B,EACtC,MAAM,EAAE,mBAAmB,GAAG,4BAA4B,EAC1D,WAAW,EAAE,OAAO,EACpB,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY,EAC1B,sBAAsB,CAAC,EAAE,sBAAsB,GAAG,IAAI,GACvD,OAAO,CAAC,CAAC,oBAAoB,GAAG,IAAI,EAAE,YAAY,CAAC,CAAC;IA2FvD;;OAEG;IACH,OAAO,CAAC,wBAAwB;IA4BhC;;;;OAIG;YACW,mBAAmB;IA6FjC;;;OAGG;YACW,sBAAsB;CAiFvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfidentialClientApplication.d.ts","sourceRoot":"","sources":["../../../src/client/ConfidentialClientApplication.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAQ3D,OAAO,EAGH,oBAAoB,EAGpB,iBAAiB,EASpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAIhF;;;;GAIG;AACH,qBAAa,6BACT,SAAQ,iBACR,YAAW,8BAA8B;IAEzC,OAAO,CAAC,gBAAgB,CAAC,CAAoB;IAE7C;;;;;;;;;;;;;;;;;;OAkBG;gBACS,aAAa,EAAE,aAAa;IA8DxC;;;;;OAKG;IACH,mBAAmB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI;IAItD;;OAEG;IACU,8BAA8B,CACvC,OAAO,EAAE,uBAAuB,GACjC,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"ConfidentialClientApplication.d.ts","sourceRoot":"","sources":["../../../src/client/ConfidentialClientApplication.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAQ3D,OAAO,EAGH,oBAAoB,EAGpB,iBAAiB,EASpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAIhF;;;;GAIG;AACH,qBAAa,6BACT,SAAQ,iBACR,YAAW,8BAA8B;IAEzC,OAAO,CAAC,gBAAgB,CAAC,CAAoB;IAE7C;;;;;;;;;;;;;;;;;;OAkBG;gBACS,aAAa,EAAE,aAAa;IA8DxC;;;;;OAKG;IACH,mBAAmB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI;IAItD;;OAEG;IACU,8BAA8B,CACvC,OAAO,EAAE,uBAAuB,GACjC,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA6GvC;;;;;;;;;;OAUG;IACU,sBAAsB,CAC/B,OAAO,EAAE,iBAAiB,GAC3B,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;CAmC1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceCodeClient.d.ts","sourceRoot":"","sources":["../../../src/client/DeviceCodeClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,oBAAoB,EACpB,UAAU,EAEV,mBAAmB,EACnB,uBAAuB,
|
|
1
|
+
{"version":3,"file":"DeviceCodeClient.d.ts","sourceRoot":"","sources":["../../../src/client/DeviceCodeClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,oBAAoB,EACpB,UAAU,EAEV,mBAAmB,EACnB,uBAAuB,EAe1B,MAAM,yBAAyB,CAAC;AAEjC;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,UAAU;gBAChC,aAAa,EAAE,mBAAmB;IAI9C;;;;OAIG;IACU,YAAY,CACrB,OAAO,EAAE,uBAAuB,GACjC,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA4BvC;;;OAGG;YACW,aAAa;IA+B3B;;;OAGG;IACI,0BAA0B,CAC7B,OAAO,EAAE,uBAAuB,GACjC,MAAM;IAaT;;;;;;;OAOG;YACW,sCAAsC;IAoCpD;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IA+BzB;;;;;OAKG;IACH,OAAO,CAAC,eAAe;IAqCvB;;;;OAIG;YACW,0BAA0B;IAwFxC;;;;OAIG;IACH,OAAO,CAAC,sBAAsB;CAqDjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnBehalfOfClient.d.ts","sourceRoot":"","sources":["../../../src/client/OnBehalfOfClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAKH,oBAAoB,EAIpB,UAAU,EAGV,mBAAmB,EACnB,uBAAuB,
|
|
1
|
+
{"version":3,"file":"OnBehalfOfClient.d.ts","sourceRoot":"","sources":["../../../src/client/OnBehalfOfClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAKH,oBAAoB,EAIpB,UAAU,EAGV,mBAAmB,EACnB,uBAAuB,EAiB1B,MAAM,yBAAyB,CAAC;AAGjC;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,UAAU;IAC5C,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,iBAAiB,CAAS;gBAEtB,aAAa,EAAE,mBAAmB;IAI9C;;;OAGG;IACU,YAAY,CACrB,OAAO,EAAE,uBAAuB,GACjC,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA4BvC;;;;;;;OAOG;YACW,6BAA6B;IAiF3C;;;;OAIG;IACH,OAAO,CAAC,0BAA0B;IAsBlC;;;;OAIG;IACH,OAAO,CAAC,8BAA8B;IA0CtC;;;;OAIG;YACW,mBAAmB;IAwDjC;;;OAGG;YACW,sBAAsB;CAuFvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PublicClientApplication.d.ts","sourceRoot":"","sources":["../../../src/client/PublicClientApplication.ts"],"names":[],"mappings":"AAUA,OAAO,EAC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AAc,EAAE,MAAM,8BAA8B,CAAC;AAK9D;;;;GAIG;AACH,qBAAa,uBACT,SAAQ,iBACR,YAAW,wBAAwB;IAEnC,OAAO,CAAC,kBAAkB,CAAC,CAAsB;IACjD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAC9B;;;;;;;;;;;;;;;;OAgBG;gBACS,aAAa,EAAE,aAAa;IAoBxC;;;;;;;;OAQG;IACU,wBAAwB,CACjC,OAAO,EAAE,iBAAiB,GAC3B,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAyCvC;;OAEG;IACG,uBAAuB,CACzB,OAAO,EAAE,kBAAkB,GAC5B,OAAO,CAAC,oBAAoB,CAAC;IAgGhC;;;;OAIG;IACG,kBAAkB,CACpB,OAAO,EAAE,iBAAiB,GAC3B,OAAO,CAAC,oBAAoB,CAAC;IA0BhC;;;;OAIG;IACG,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAerD;;;OAGG;IACG,cAAc,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAY9C;;;;OAIG;YACW,kBAAkB;CAsCnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UsernamePasswordClient.d.ts","sourceRoot":"","sources":["../../../src/client/UsernamePasswordClient.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,oBAAoB,EAEpB,UAAU,EAGV,mBAAmB,EACnB,6BAA6B,
|
|
1
|
+
{"version":3,"file":"UsernamePasswordClient.d.ts","sourceRoot":"","sources":["../../../src/client/UsernamePasswordClient.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,oBAAoB,EAEpB,UAAU,EAGV,mBAAmB,EACnB,6BAA6B,EAYhC,MAAM,yBAAyB,CAAC;AAEjC;;;;;GAKG;AACH,qBAAa,sBAAuB,SAAQ,UAAU;gBACtC,aAAa,EAAE,mBAAmB;IAI9C;;;;OAIG;IACG,YAAY,CACd,OAAO,EAAE,6BAA6B,GACvC,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA8BvC;;;;OAIG;YACW,mBAAmB;IAmCjC;;;OAGG;YACW,sBAAsB;CA0FvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManagedIdentityRequestParameters.d.ts","sourceRoot":"","sources":["../../../src/config/ManagedIdentityRequestParameters.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ManagedIdentityRequestParameters.d.ts","sourceRoot":"","sources":["../../../src/config/ManagedIdentityRequestParameters.ts"],"names":[],"mappings":"AAUA,OAAO,EACH,UAAU,EAIV,aAAa,EAChB,MAAM,uBAAuB,CAAC;AAG/B,qBAAa,gCAAgC;IACzC,OAAO,CAAC,aAAa,CAAS;IACvB,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,WAAW,EAAE,aAAa,CAAC;gBAG9B,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,aAAa;IAgBxB,UAAU,IAAI,MAAM;IAkBpB,2BAA2B,IAAI,MAAM;CAY/C"}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -40,6 +40,10 @@ export type { SilentFlowRequest } from "./request/SilentFlowRequest.js";
|
|
|
40
40
|
export type { InteractiveRequest } from "./request/InteractiveRequest.js";
|
|
41
41
|
export type { SignOutRequest } from "./request/SignOutRequest.js";
|
|
42
42
|
export type { ManagedIdentityRequestParams } from "./request/ManagedIdentityRequestParams.js";
|
|
43
|
-
export { PromptValue, ResponseMode, AuthorizationCodePayload, AuthenticationResult,
|
|
43
|
+
export { PromptValue, ResponseMode, AuthorizationCodePayload, AuthenticationResult, AuthorizeResponse,
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated Use AuthorizeResponse instead
|
|
46
|
+
*/
|
|
47
|
+
AuthorizeResponse as ServerAuthorizationCodeResponse, IdTokenClaims, AccountInfo, ValidCacheType, AuthError, AuthErrorMessage, AuthErrorCodes, ClientAuthError, ClientAuthErrorCodes, ClientAuthErrorMessage, ClientConfigurationError, ClientConfigurationErrorCodes, ClientConfigurationErrorMessage, InteractionRequiredAuthError, InteractionRequiredAuthErrorCodes, InteractionRequiredAuthErrorMessage, ServerError, INetworkModule, NetworkRequestOptions, NetworkResponse, Logger, LogLevel, ProtocolMode, ICachePlugin, TokenCacheContext, ISerializableTokenCache, AzureCloudInstance, AzureCloudOptions, IAppTokenProvider, AppTokenProviderParameters, AppTokenProviderResult, INativeBrokerPlugin, ClientAssertionCallback, } from "@azure/msal-common/node";
|
|
44
48
|
export { version } from "./packageMetadata.js";
|
|
45
49
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAKA;;;GAGG;AAEH;;;GAGG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAKA;;;GAGG;AAEH;;;GAGG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,CAAC;AAGrB,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,OAAO,E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xE,YAAY,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AACpF,YAAY,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,YAAY,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACxE,YAAY,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,YAAY,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,YAAY,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AAG9F,OAAO,EAEH,WAAW,EACX,YAAY,EACZ,wBAAwB,EAExB,oBAAoB,EACpB,iBAAiB;AACjB;;GAEG;AACH,iBAAiB,IAAI,+BAA+B,EACpD,aAAa,EAEb,WAAW,EACX,cAAc,EAEd,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,6BAA6B,EAC7B,+BAA+B,EAC/B,4BAA4B,EAC5B,iCAAiC,EACjC,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,EAEjB,iBAAiB,EACjB,0BAA0B,EAC1B,sBAAsB,EACtB,mBAAmB,EACnB,uBAAuB,GAC1B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AuthorizeResponse } from "@azure/msal-common/node";
|
|
2
2
|
/**
|
|
3
3
|
* Interface for LoopbackClient allowing to replace the default loopback server with a custom implementation.
|
|
4
4
|
* @public
|
|
5
5
|
*/
|
|
6
6
|
export interface ILoopbackClient {
|
|
7
|
-
listenForAuthCode(successTemplate?: string, errorTemplate?: string): Promise<
|
|
7
|
+
listenForAuthCode(successTemplate?: string, errorTemplate?: string): Promise<AuthorizeResponse>;
|
|
8
8
|
getRedirectUri(): string;
|
|
9
9
|
closeServer(): void;
|
|
10
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ILoopbackClient.d.ts","sourceRoot":"","sources":["../../../src/network/ILoopbackClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE
|
|
1
|
+
{"version":3,"file":"ILoopbackClient.d.ts","sourceRoot":"","sources":["../../../src/network/ILoopbackClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC5B,iBAAiB,CACb,eAAe,CAAC,EAAE,MAAM,EACxB,aAAa,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC9B,cAAc,IAAI,MAAM,CAAC;IACzB,WAAW,IAAI,IAAI,CAAC;CACvB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AuthorizeResponse } from "@azure/msal-common/node";
|
|
2
2
|
import { ILoopbackClient } from "./ILoopbackClient.js";
|
|
3
3
|
export declare class LoopbackClient implements ILoopbackClient {
|
|
4
4
|
private server;
|
|
@@ -8,7 +8,7 @@ export declare class LoopbackClient implements ILoopbackClient {
|
|
|
8
8
|
* @param errorTemplate
|
|
9
9
|
* @returns
|
|
10
10
|
*/
|
|
11
|
-
listenForAuthCode(successTemplate?: string, errorTemplate?: string): Promise<
|
|
11
|
+
listenForAuthCode(successTemplate?: string, errorTemplate?: string): Promise<AuthorizeResponse>;
|
|
12
12
|
/**
|
|
13
13
|
* Get the port that the loopback server is running on
|
|
14
14
|
* @returns
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoopbackClient.d.ts","sourceRoot":"","sources":["../../../src/network/LoopbackClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH
|
|
1
|
+
{"version":3,"file":"LoopbackClient.d.ts","sourceRoot":"","sources":["../../../src/network/LoopbackClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,iBAAiB,EAGpB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,qBAAa,cAAe,YAAW,eAAe;IAClD,OAAO,CAAC,MAAM,CAA0B;IAExC;;;;;OAKG;IACG,iBAAiB,CACnB,eAAe,CAAC,EAAE,MAAM,EACxB,aAAa,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,iBAAiB,CAAC;IAkD7B;;;OAGG;IACH,cAAc,IAAI,MAAM;IAgBxB;;OAEG;IACH,WAAW,IAAI,IAAI;CAetB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Authority, CommonAuthorizationUrlRequest, Logger } from "@azure/msal-common/node";
|
|
2
|
+
import { NodeConfiguration } from "../config/Configuration.js";
|
|
3
|
+
/**
|
|
4
|
+
* Constructs the full /authorize URL with request parameters
|
|
5
|
+
* @param config
|
|
6
|
+
* @param authority
|
|
7
|
+
* @param request
|
|
8
|
+
* @param logger
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
export declare function getAuthCodeRequestUrl(config: NodeConfiguration, authority: Authority, request: CommonAuthorizationUrlRequest, logger: Logger): string;
|
|
12
|
+
//# sourceMappingURL=Authorize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Authorize.d.ts","sourceRoot":"","sources":["../../../src/protocol/Authorize.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,SAAS,EAET,6BAA6B,EAC7B,MAAM,EAGT,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAI/D;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACjC,MAAM,EAAE,iBAAiB,EACzB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,6BAA6B,EACtC,MAAM,EAAE,MAAM,GACf,MAAM,CAgCR"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@azure/msal-node",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.4.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Microsoft",
|
|
7
7
|
"email": "nugetaad@microsoft.com",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"yargs": "^17.3.1"
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"@azure/msal-common": "15.
|
|
85
|
+
"@azure/msal-common": "15.3.0",
|
|
86
86
|
"jsonwebtoken": "^9.0.0",
|
|
87
87
|
"uuid": "^8.3.0"
|
|
88
88
|
},
|
|
@@ -57,6 +57,7 @@ import { version, name } from "../packageMetadata.js";
|
|
|
57
57
|
import { UsernamePasswordRequest } from "../request/UsernamePasswordRequest.js";
|
|
58
58
|
import { NodeAuthError } from "../error/NodeAuthError.js";
|
|
59
59
|
import { UsernamePasswordClient } from "./UsernamePasswordClient.js";
|
|
60
|
+
import { getAuthCodeRequestUrl } from "../protocol/Authorize.js";
|
|
60
61
|
|
|
61
62
|
/**
|
|
62
63
|
* Base abstract class for all ClientApplications - public and confidential
|
|
@@ -132,22 +133,18 @@ export abstract class ClientApplication {
|
|
|
132
133
|
authenticationScheme: AuthenticationScheme.BEARER,
|
|
133
134
|
};
|
|
134
135
|
|
|
135
|
-
const
|
|
136
|
+
const discoveredAuthority = await this.createAuthority(
|
|
136
137
|
validRequest.authority,
|
|
137
138
|
validRequest.correlationId,
|
|
138
|
-
validRequest.redirectUri,
|
|
139
|
-
undefined,
|
|
140
139
|
undefined,
|
|
141
140
|
request.azureCloudOptions
|
|
142
141
|
);
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
validRequest.correlationId
|
|
142
|
+
return getAuthCodeRequestUrl(
|
|
143
|
+
this.config,
|
|
144
|
+
discoveredAuthority,
|
|
145
|
+
validRequest,
|
|
146
|
+
this.logger
|
|
149
147
|
);
|
|
150
|
-
return authorizationCodeClient.getAuthCodeUrl(validRequest);
|
|
151
148
|
}
|
|
152
149
|
|
|
153
150
|
/**
|
|
@@ -180,14 +177,18 @@ export abstract class ClientApplication {
|
|
|
180
177
|
validRequest.correlationId
|
|
181
178
|
);
|
|
182
179
|
try {
|
|
183
|
-
const
|
|
180
|
+
const discoveredAuthority = await this.createAuthority(
|
|
184
181
|
validRequest.authority,
|
|
185
182
|
validRequest.correlationId,
|
|
186
|
-
validRequest.redirectUri,
|
|
187
|
-
serverTelemetryManager,
|
|
188
183
|
undefined,
|
|
189
184
|
request.azureCloudOptions
|
|
190
185
|
);
|
|
186
|
+
const authClientConfig = await this.buildOauthClientConfiguration(
|
|
187
|
+
discoveredAuthority,
|
|
188
|
+
validRequest.correlationId,
|
|
189
|
+
validRequest.redirectUri,
|
|
190
|
+
serverTelemetryManager
|
|
191
|
+
);
|
|
191
192
|
const authorizationCodeClient = new AuthorizationCodeClient(
|
|
192
193
|
authClientConfig
|
|
193
194
|
);
|
|
@@ -233,14 +234,18 @@ export abstract class ClientApplication {
|
|
|
233
234
|
validRequest.correlationId
|
|
234
235
|
);
|
|
235
236
|
try {
|
|
237
|
+
const discoveredAuthority = await this.createAuthority(
|
|
238
|
+
validRequest.authority,
|
|
239
|
+
validRequest.correlationId,
|
|
240
|
+
undefined,
|
|
241
|
+
request.azureCloudOptions
|
|
242
|
+
);
|
|
236
243
|
const refreshTokenClientConfig =
|
|
237
244
|
await this.buildOauthClientConfiguration(
|
|
238
|
-
|
|
245
|
+
discoveredAuthority,
|
|
239
246
|
validRequest.correlationId,
|
|
240
247
|
validRequest.redirectUri || "",
|
|
241
|
-
serverTelemetryManager
|
|
242
|
-
undefined,
|
|
243
|
-
request.azureCloudOptions
|
|
248
|
+
serverTelemetryManager
|
|
244
249
|
);
|
|
245
250
|
const refreshTokenClient = new RefreshTokenClient(
|
|
246
251
|
refreshTokenClientConfig
|
|
@@ -283,14 +288,18 @@ export abstract class ClientApplication {
|
|
|
283
288
|
);
|
|
284
289
|
|
|
285
290
|
try {
|
|
291
|
+
const discoveredAuthority = await this.createAuthority(
|
|
292
|
+
validRequest.authority,
|
|
293
|
+
validRequest.correlationId,
|
|
294
|
+
undefined,
|
|
295
|
+
request.azureCloudOptions
|
|
296
|
+
);
|
|
286
297
|
const clientConfiguration =
|
|
287
298
|
await this.buildOauthClientConfiguration(
|
|
288
|
-
|
|
299
|
+
discoveredAuthority,
|
|
289
300
|
validRequest.correlationId,
|
|
290
301
|
validRequest.redirectUri || "",
|
|
291
|
-
serverTelemetryManager
|
|
292
|
-
undefined,
|
|
293
|
-
validRequest.azureCloudOptions
|
|
302
|
+
serverTelemetryManager
|
|
294
303
|
);
|
|
295
304
|
const silentFlowClient = new SilentFlowClient(clientConfiguration);
|
|
296
305
|
this.logger.verbose(
|
|
@@ -391,14 +400,18 @@ export abstract class ClientApplication {
|
|
|
391
400
|
validRequest.correlationId
|
|
392
401
|
);
|
|
393
402
|
try {
|
|
403
|
+
const discoveredAuthority = await this.createAuthority(
|
|
404
|
+
validRequest.authority,
|
|
405
|
+
validRequest.correlationId,
|
|
406
|
+
undefined,
|
|
407
|
+
request.azureCloudOptions
|
|
408
|
+
);
|
|
394
409
|
const usernamePasswordClientConfig =
|
|
395
410
|
await this.buildOauthClientConfiguration(
|
|
396
|
-
|
|
411
|
+
discoveredAuthority,
|
|
397
412
|
validRequest.correlationId,
|
|
398
413
|
"",
|
|
399
|
-
serverTelemetryManager
|
|
400
|
-
undefined,
|
|
401
|
-
request.azureCloudOptions
|
|
414
|
+
serverTelemetryManager
|
|
402
415
|
);
|
|
403
416
|
const usernamePasswordClient = new UsernamePasswordClient(
|
|
404
417
|
usernamePasswordClientConfig
|
|
@@ -465,31 +478,16 @@ export abstract class ClientApplication {
|
|
|
465
478
|
* @param serverTelemetryManager - initializes servertelemetry if passed
|
|
466
479
|
*/
|
|
467
480
|
protected async buildOauthClientConfiguration(
|
|
468
|
-
|
|
481
|
+
discoveredAuthority: Authority,
|
|
469
482
|
requestCorrelationId: string,
|
|
470
483
|
redirectUri: string,
|
|
471
|
-
serverTelemetryManager?: ServerTelemetryManager
|
|
472
|
-
azureRegionConfiguration?: AzureRegionConfiguration,
|
|
473
|
-
azureCloudOptions?: AzureCloudOptions
|
|
484
|
+
serverTelemetryManager?: ServerTelemetryManager
|
|
474
485
|
): Promise<ClientConfiguration> {
|
|
475
486
|
this.logger.verbose(
|
|
476
487
|
"buildOauthClientConfiguration called",
|
|
477
488
|
requestCorrelationId
|
|
478
489
|
);
|
|
479
490
|
|
|
480
|
-
// precedence - azureCloudInstance + tenant >> authority and request >> config
|
|
481
|
-
const userAzureCloudOptions = azureCloudOptions
|
|
482
|
-
? azureCloudOptions
|
|
483
|
-
: this.config.auth.azureCloudOptions;
|
|
484
|
-
|
|
485
|
-
// using null assertion operator as we ensure that all config values have default values in buildConfiguration()
|
|
486
|
-
const discoveredAuthority = await this.createAuthority(
|
|
487
|
-
authority,
|
|
488
|
-
requestCorrelationId,
|
|
489
|
-
azureRegionConfiguration,
|
|
490
|
-
userAzureCloudOptions
|
|
491
|
-
);
|
|
492
|
-
|
|
493
491
|
this.logger.info(
|
|
494
492
|
`Building oauth client configuration with the following authority: ${discoveredAuthority.tokenEndpoint}.`,
|
|
495
493
|
requestCorrelationId
|
|
@@ -640,7 +638,7 @@ export abstract class ClientApplication {
|
|
|
640
638
|
* object. If no authority set in application object, then default to common authority.
|
|
641
639
|
* @param authorityString - authority from user configuration
|
|
642
640
|
*/
|
|
643
|
-
|
|
641
|
+
protected async createAuthority(
|
|
644
642
|
authorityString: string,
|
|
645
643
|
requestCorrelationId: string,
|
|
646
644
|
azureRegionConfiguration?: AzureRegionConfiguration,
|
|
@@ -651,7 +649,7 @@ export abstract class ClientApplication {
|
|
|
651
649
|
// build authority string based on auth params - azureCloudInstance is prioritized if provided
|
|
652
650
|
const authorityUrl = Authority.generateAuthority(
|
|
653
651
|
authorityString,
|
|
654
|
-
azureCloudOptions
|
|
652
|
+
azureCloudOptions || this.config.auth.azureCloudOptions
|
|
655
653
|
);
|
|
656
654
|
|
|
657
655
|
const authorityOptions: AuthorityOptions = {
|
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
createClientAuthError,
|
|
35
35
|
ClientAssertion,
|
|
36
36
|
getClientAssertion,
|
|
37
|
+
UrlUtils,
|
|
37
38
|
} from "@azure/msal-common/node";
|
|
38
39
|
import {
|
|
39
40
|
ManagedIdentityConfiguration,
|
|
@@ -336,32 +337,46 @@ export class ClientCredentialClient extends BaseClient {
|
|
|
336
337
|
private async createTokenRequestBody(
|
|
337
338
|
request: CommonClientCredentialRequest
|
|
338
339
|
): Promise<string> {
|
|
339
|
-
const
|
|
340
|
+
const parameters = new Map<string, string>();
|
|
340
341
|
|
|
341
|
-
|
|
342
|
+
RequestParameterBuilder.addClientId(
|
|
343
|
+
parameters,
|
|
344
|
+
this.config.authOptions.clientId
|
|
345
|
+
);
|
|
342
346
|
|
|
343
|
-
|
|
347
|
+
RequestParameterBuilder.addScopes(parameters, request.scopes, false);
|
|
344
348
|
|
|
345
|
-
|
|
349
|
+
RequestParameterBuilder.addGrantType(
|
|
350
|
+
parameters,
|
|
351
|
+
GrantType.CLIENT_CREDENTIALS_GRANT
|
|
352
|
+
);
|
|
346
353
|
|
|
347
|
-
|
|
348
|
-
|
|
354
|
+
RequestParameterBuilder.addLibraryInfo(
|
|
355
|
+
parameters,
|
|
356
|
+
this.config.libraryInfo
|
|
357
|
+
);
|
|
358
|
+
RequestParameterBuilder.addApplicationTelemetry(
|
|
359
|
+
parameters,
|
|
349
360
|
this.config.telemetry.application
|
|
350
361
|
);
|
|
351
362
|
|
|
352
|
-
|
|
363
|
+
RequestParameterBuilder.addThrottling(parameters);
|
|
353
364
|
|
|
354
365
|
if (this.serverTelemetryManager) {
|
|
355
|
-
|
|
366
|
+
RequestParameterBuilder.addServerTelemetry(
|
|
367
|
+
parameters,
|
|
368
|
+
this.serverTelemetryManager
|
|
369
|
+
);
|
|
356
370
|
}
|
|
357
371
|
|
|
358
372
|
const correlationId =
|
|
359
373
|
request.correlationId ||
|
|
360
374
|
this.config.cryptoInterface.createNewGuid();
|
|
361
|
-
|
|
375
|
+
RequestParameterBuilder.addCorrelationId(parameters, correlationId);
|
|
362
376
|
|
|
363
377
|
if (this.config.clientCredentials.clientSecret) {
|
|
364
|
-
|
|
378
|
+
RequestParameterBuilder.addClientSecret(
|
|
379
|
+
parameters,
|
|
365
380
|
this.config.clientCredentials.clientSecret
|
|
366
381
|
);
|
|
367
382
|
}
|
|
@@ -372,14 +387,16 @@ export class ClientCredentialClient extends BaseClient {
|
|
|
372
387
|
this.config.clientCredentials.clientAssertion;
|
|
373
388
|
|
|
374
389
|
if (clientAssertion) {
|
|
375
|
-
|
|
390
|
+
RequestParameterBuilder.addClientAssertion(
|
|
391
|
+
parameters,
|
|
376
392
|
await getClientAssertion(
|
|
377
393
|
clientAssertion.assertion,
|
|
378
394
|
this.config.authOptions.clientId,
|
|
379
395
|
request.resourceRequestUri
|
|
380
396
|
)
|
|
381
397
|
);
|
|
382
|
-
|
|
398
|
+
RequestParameterBuilder.addClientAssertionType(
|
|
399
|
+
parameters,
|
|
383
400
|
clientAssertion.assertionType
|
|
384
401
|
);
|
|
385
402
|
}
|
|
@@ -389,12 +406,13 @@ export class ClientCredentialClient extends BaseClient {
|
|
|
389
406
|
(this.config.authOptions.clientCapabilities &&
|
|
390
407
|
this.config.authOptions.clientCapabilities.length > 0)
|
|
391
408
|
) {
|
|
392
|
-
|
|
409
|
+
RequestParameterBuilder.addClaims(
|
|
410
|
+
parameters,
|
|
393
411
|
request.claims,
|
|
394
412
|
this.config.authOptions.clientCapabilities
|
|
395
413
|
);
|
|
396
414
|
}
|
|
397
415
|
|
|
398
|
-
return
|
|
416
|
+
return UrlUtils.mapToQueryString(parameters);
|
|
399
417
|
}
|
|
400
418
|
}
|
|
@@ -221,14 +221,18 @@ export class ConfidentialClientApplication
|
|
|
221
221
|
validRequest.skipCache
|
|
222
222
|
);
|
|
223
223
|
try {
|
|
224
|
+
const discoveredAuthority = await this.createAuthority(
|
|
225
|
+
validRequest.authority,
|
|
226
|
+
validRequest.correlationId,
|
|
227
|
+
azureRegionConfiguration,
|
|
228
|
+
request.azureCloudOptions
|
|
229
|
+
);
|
|
224
230
|
const clientCredentialConfig =
|
|
225
231
|
await this.buildOauthClientConfiguration(
|
|
226
|
-
|
|
232
|
+
discoveredAuthority,
|
|
227
233
|
validRequest.correlationId,
|
|
228
234
|
"",
|
|
229
|
-
serverTelemetryManager
|
|
230
|
-
azureRegionConfiguration,
|
|
231
|
-
request.azureCloudOptions
|
|
235
|
+
serverTelemetryManager
|
|
232
236
|
);
|
|
233
237
|
const clientCredentialClient = new ClientCredentialClient(
|
|
234
238
|
clientCredentialConfig,
|
|
@@ -271,14 +275,18 @@ export class ConfidentialClientApplication
|
|
|
271
275
|
...(await this.initializeBaseRequest(request)),
|
|
272
276
|
};
|
|
273
277
|
try {
|
|
274
|
-
const
|
|
278
|
+
const discoveredAuthority = await this.createAuthority(
|
|
275
279
|
validRequest.authority,
|
|
276
280
|
validRequest.correlationId,
|
|
277
|
-
"",
|
|
278
|
-
undefined,
|
|
279
281
|
undefined,
|
|
280
282
|
request.azureCloudOptions
|
|
281
283
|
);
|
|
284
|
+
const onBehalfOfConfig = await this.buildOauthClientConfiguration(
|
|
285
|
+
discoveredAuthority,
|
|
286
|
+
validRequest.correlationId,
|
|
287
|
+
"",
|
|
288
|
+
undefined
|
|
289
|
+
);
|
|
282
290
|
const oboClient = new OnBehalfOfClient(onBehalfOfConfig);
|
|
283
291
|
this.logger.verbose(
|
|
284
292
|
"On behalf of client created",
|