@azure/msal-node 2.0.2 → 2.1.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/README.md +3 -1
- package/dist/cache/NodeStorage.cjs +1 -1
- package/dist/cache/NodeStorage.cjs.map +1 -1
- package/dist/cache/NodeStorage.d.ts +1 -1
- package/dist/cache/NodeStorage.d.ts.map +1 -1
- package/dist/cache/NodeStorage.mjs +1 -1
- package/dist/cache/NodeStorage.mjs.map +1 -1
- package/dist/cache/TokenCache.cjs +5 -9
- package/dist/cache/TokenCache.cjs.map +1 -1
- package/dist/cache/TokenCache.d.ts +3 -3
- package/dist/cache/TokenCache.d.ts.map +1 -1
- package/dist/cache/TokenCache.mjs +6 -10
- package/dist/cache/TokenCache.mjs.map +1 -1
- package/dist/cache/distributed/DistributedCachePlugin.cjs +1 -1
- package/dist/cache/distributed/DistributedCachePlugin.cjs.map +1 -1
- package/dist/cache/distributed/DistributedCachePlugin.d.ts +2 -2
- package/dist/cache/distributed/DistributedCachePlugin.d.ts.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.cjs +2 -4
- package/dist/cache/serializer/Deserializer.cjs.map +1 -1
- package/dist/cache/serializer/Deserializer.d.ts +1 -1
- package/dist/cache/serializer/Deserializer.d.ts.map +1 -1
- package/dist/cache/serializer/Deserializer.mjs +3 -5
- package/dist/cache/serializer/Deserializer.mjs.map +1 -1
- package/dist/cache/serializer/Serializer.cjs +1 -1
- package/dist/cache/serializer/Serializer.cjs.map +1 -1
- package/dist/cache/serializer/Serializer.d.ts +1 -1
- package/dist/cache/serializer/Serializer.d.ts.map +1 -1
- package/dist/cache/serializer/Serializer.mjs +1 -1
- package/dist/cache/serializer/Serializer.mjs.map +1 -1
- package/dist/client/ClientApplication.cjs +2 -2
- package/dist/client/ClientApplication.cjs.map +1 -1
- package/dist/client/ClientApplication.d.ts +10 -10
- package/dist/client/ClientApplication.d.ts.map +1 -1
- package/dist/client/ClientApplication.mjs +2 -2
- package/dist/client/ClientApplication.mjs.map +1 -1
- package/dist/client/ClientAssertion.cjs +1 -1
- package/dist/client/ClientAssertion.cjs.map +1 -1
- package/dist/client/ClientAssertion.d.ts +1 -1
- package/dist/client/ClientAssertion.d.ts.map +1 -1
- package/dist/client/ClientAssertion.mjs +1 -1
- package/dist/client/ClientAssertion.mjs.map +1 -1
- package/dist/client/ClientCredentialClient.cjs +26 -4
- package/dist/client/ClientCredentialClient.cjs.map +1 -1
- package/dist/client/ClientCredentialClient.d.ts +1 -0
- package/dist/client/ClientCredentialClient.d.ts.map +1 -1
- package/dist/client/ClientCredentialClient.mjs +27 -5
- package/dist/client/ClientCredentialClient.mjs.map +1 -1
- package/dist/client/ConfidentialClientApplication.cjs +4 -5
- package/dist/client/ConfidentialClientApplication.cjs.map +1 -1
- package/dist/client/ConfidentialClientApplication.d.ts +5 -5
- package/dist/client/ConfidentialClientApplication.d.ts.map +1 -1
- package/dist/client/ConfidentialClientApplication.mjs +5 -6
- package/dist/client/ConfidentialClientApplication.mjs.map +1 -1
- package/dist/client/DeviceCodeClient.cjs +3 -3
- package/dist/client/DeviceCodeClient.cjs.map +1 -1
- package/dist/client/DeviceCodeClient.d.ts.map +1 -1
- package/dist/client/DeviceCodeClient.mjs +4 -4
- package/dist/client/DeviceCodeClient.mjs.map +1 -1
- package/dist/client/IConfidentialClientApplication.d.ts +8 -8
- package/dist/client/IConfidentialClientApplication.d.ts.map +1 -1
- package/dist/client/IPublicClientApplication.d.ts +9 -9
- package/dist/client/IPublicClientApplication.d.ts.map +1 -1
- package/dist/client/OnBehalfOfClient.cjs +7 -8
- package/dist/client/OnBehalfOfClient.cjs.map +1 -1
- package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
- package/dist/client/OnBehalfOfClient.mjs +7 -8
- package/dist/client/OnBehalfOfClient.mjs.map +1 -1
- package/dist/client/PublicClientApplication.cjs +36 -29
- package/dist/client/PublicClientApplication.cjs.map +1 -1
- package/dist/client/PublicClientApplication.d.ts +7 -7
- package/dist/client/PublicClientApplication.d.ts.map +1 -1
- package/dist/client/PublicClientApplication.mjs +40 -33
- package/dist/client/PublicClientApplication.mjs.map +1 -1
- package/dist/client/UsernamePasswordClient.cjs +2 -2
- package/dist/client/UsernamePasswordClient.cjs.map +1 -1
- package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
- package/dist/client/UsernamePasswordClient.mjs +2 -2
- package/dist/client/UsernamePasswordClient.mjs.map +1 -1
- package/dist/config/Configuration.cjs +1 -1
- package/dist/config/Configuration.cjs.map +1 -1
- package/dist/config/Configuration.mjs +1 -1
- package/dist/config/Configuration.mjs.map +1 -1
- package/dist/crypto/CryptoProvider.cjs +1 -1
- package/dist/crypto/CryptoProvider.cjs.map +1 -1
- package/dist/crypto/CryptoProvider.mjs +1 -1
- package/dist/crypto/CryptoProvider.mjs.map +1 -1
- package/dist/crypto/GuidGenerator.cjs +1 -1
- package/dist/crypto/GuidGenerator.cjs.map +1 -1
- package/dist/crypto/GuidGenerator.mjs +1 -1
- package/dist/crypto/GuidGenerator.mjs.map +1 -1
- package/dist/crypto/HashUtils.cjs +1 -1
- package/dist/crypto/HashUtils.cjs.map +1 -1
- package/dist/crypto/HashUtils.mjs +1 -1
- package/dist/crypto/HashUtils.mjs.map +1 -1
- package/dist/crypto/PkceGenerator.cjs +1 -1
- package/dist/crypto/PkceGenerator.cjs.map +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/crypto/PkceGenerator.mjs.map +1 -1
- package/dist/error/NodeAuthError.cjs +1 -1
- package/dist/error/NodeAuthError.cjs.map +1 -1
- package/dist/error/NodeAuthError.mjs +1 -1
- package/dist/error/NodeAuthError.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +32 -32
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/internals.cjs +1 -1
- package/dist/internals.cjs.map +1 -1
- package/dist/internals.d.ts +2 -2
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.mjs +1 -1
- package/dist/internals.mjs.map +1 -1
- package/dist/network/HttpClient.cjs +10 -9
- package/dist/network/HttpClient.cjs.map +1 -1
- package/dist/network/HttpClient.d.ts.map +1 -1
- package/dist/network/HttpClient.mjs +3 -2
- package/dist/network/HttpClient.mjs.map +1 -1
- package/dist/network/LoopbackClient.cjs +2 -2
- package/dist/network/LoopbackClient.cjs.map +1 -1
- package/dist/network/LoopbackClient.d.ts +1 -1
- package/dist/network/LoopbackClient.d.ts.map +1 -1
- package/dist/network/LoopbackClient.mjs +3 -3
- package/dist/network/LoopbackClient.mjs.map +1 -1
- package/dist/packageMetadata.cjs +2 -2
- package/dist/packageMetadata.cjs.map +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/packageMetadata.mjs.map +1 -1
- package/dist/request/InteractiveRequest.d.ts +2 -2
- package/dist/request/InteractiveRequest.d.ts.map +1 -1
- package/dist/utils/Constants.cjs +1 -11
- package/dist/utils/Constants.cjs.map +1 -1
- package/dist/utils/Constants.d.ts +0 -10
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.mjs +2 -11
- package/dist/utils/Constants.mjs.map +1 -1
- package/dist/utils/EncodingUtils.cjs +1 -1
- package/dist/utils/EncodingUtils.cjs.map +1 -1
- package/dist/utils/EncodingUtils.mjs +1 -1
- package/dist/utils/EncodingUtils.mjs.map +1 -1
- package/dist/utils/NetworkUtils.cjs +1 -1
- package/dist/utils/NetworkUtils.cjs.map +1 -1
- package/dist/utils/NetworkUtils.mjs +1 -1
- package/dist/utils/NetworkUtils.mjs.map +1 -1
- package/package.json +8 -5
- package/src/cache/ITokenCache.ts +24 -0
- package/src/cache/NodeStorage.ts +533 -0
- package/src/cache/TokenCache.ts +358 -0
- package/src/cache/distributed/DistributedCachePlugin.ts +56 -0
- package/src/cache/distributed/ICacheClient.ts +23 -0
- package/src/cache/distributed/IPartitionManager.ts +35 -0
- package/src/cache/serializer/Deserializer.ts +218 -0
- package/src/cache/serializer/Serializer.ts +173 -0
- package/src/cache/serializer/SerializerTypes.ts +121 -0
- package/src/client/ClientApplication.ts +595 -0
- package/src/client/ClientAssertion.ts +160 -0
- package/src/client/ClientCredentialClient.ts +348 -0
- package/src/client/ConfidentialClientApplication.ts +261 -0
- package/src/client/DeviceCodeClient.ts +360 -0
- package/src/client/IConfidentialClientApplication.ts +72 -0
- package/src/client/IPublicClientApplication.ts +72 -0
- package/src/client/OnBehalfOfClient.ts +361 -0
- package/src/client/PublicClientApplication.ts +283 -0
- package/src/client/UsernamePasswordClient.ts +180 -0
- package/src/config/Configuration.ts +201 -0
- package/src/crypto/CryptoProvider.ts +98 -0
- package/src/crypto/GuidGenerator.ts +28 -0
- package/src/crypto/HashUtils.ts +17 -0
- package/src/crypto/PkceGenerator.ts +63 -0
- package/src/error/NodeAuthError.ts +117 -0
- package/src/index.ts +121 -0
- package/src/internals.ts +12 -0
- package/src/network/HttpClient.ts +425 -0
- package/src/network/ILoopbackClient.ts +19 -0
- package/src/network/LoopbackClient.ts +126 -0
- package/src/packageMetadata.ts +3 -0
- package/src/request/AuthorizationCodeRequest.ts +39 -0
- package/src/request/AuthorizationUrlRequest.ts +50 -0
- package/src/request/ClientCredentialRequest.ts +29 -0
- package/src/request/DeviceCodeRequest.ts +34 -0
- package/src/request/InteractiveRequest.ts +39 -0
- package/src/request/OnBehalfOfRequest.ts +30 -0
- package/src/request/RefreshTokenRequest.ts +34 -0
- package/src/request/SignOutRequest.ts +11 -0
- package/src/request/SilentFlowRequest.ts +32 -0
- package/src/request/UsernamePasswordRequest.ts +36 -0
- package/src/utils/Constants.ts +103 -0
- package/src/utils/EncodingUtils.ts +50 -0
- package/src/utils/NetworkUtils.ts +49 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @azure/msal-node v2.0
|
|
1
|
+
/*! @azure/msal-node v2.1.0 2023-09-05 */
|
|
2
2
|
'use strict';
|
|
3
|
-
import { BaseClient, TimeUtils, ResponseHandler, UrlString, RequestParameterBuilder,
|
|
3
|
+
import { BaseClient, TimeUtils, ResponseHandler, UrlString, RequestParameterBuilder, ClientAuthError, Constants, ServerError, GrantType, StringUtils } from '@azure/msal-common';
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -91,7 +91,7 @@ class DeviceCodeClient extends BaseClient {
|
|
|
91
91
|
if (request.extraQueryParameters) {
|
|
92
92
|
parameterBuilder.addExtraQueryParameters(request.extraQueryParameters);
|
|
93
93
|
}
|
|
94
|
-
if (
|
|
94
|
+
if (request.claims ||
|
|
95
95
|
(this.config.authOptions.clientCapabilities &&
|
|
96
96
|
this.config.authOptions.clientCapabilities.length > 0)) {
|
|
97
97
|
parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);
|
|
@@ -155,7 +155,7 @@ class DeviceCodeClient extends BaseClient {
|
|
|
155
155
|
shrClaims: request.shrClaims,
|
|
156
156
|
sshKid: request.sshKid,
|
|
157
157
|
};
|
|
158
|
-
const response = await this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint);
|
|
158
|
+
const response = await this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint, request.correlationId);
|
|
159
159
|
if (response.body && response.body.error) {
|
|
160
160
|
// user authorization is pending. Sleep for polling interval and try again
|
|
161
161
|
if (response.body.error === Constants.AUTHORIZATION_PENDING) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceCodeClient.mjs","sources":["../../src/client/DeviceCodeClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"DeviceCodeClient.mjs","sources":["../../src/client/DeviceCodeClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAKA;AAoBA;;AAEG;AAEa;AAIZ;;;;AAIG,QAAA,KAAA,CAAA,aAAA,CAAA,CAAA;KACsB;AA8BzB;;;AAGG;;AA+BH,IAAA,MAAA,YAAA,CAAA,OAAA,EAAA;;;AAGG,QAAA,MAAA,YAAA,GAAA,SAAA,CAAA,UAAA,EAAA,CAAA;AACH,QAAA,MAAA,QAAA,GAAA,MAA2B,IAAA,CAAA,0BAAS,CAAuB,OAAS,EAAA,kBAAA,CAAA,CAAA;AAYpE,QAAA,MAAA,eAAA,GAAA,IAAA,eAAA,CAAA,IAAA,CAAA,MAAA,CAAA,WAAA,CAAA,QAAA,EAAA,IAAA,CAAA,YAAA,EAAA,IAAA,CAAA,WAAA,EAAA,IAAA,CAAA,MAAA,EAAA,IAAA,CAAA,MAAA,CAAA,iBAAA,EAAA,IAAA,CAAA,MAAA,CAAA,iBAAA,CAAA,CAAA;;;;;AAKG;;AAmCH;;AAEG,IAAA,MAAA,aAAA,CAAA,OAAA,EAAA;AACH,QAAA,MAAyB,qBAAA,GAAA,IAAA,CAAA,0BAAA,CAAA,OAAA,CAAA,CAAA;AA2BzB,QAAA,MAAA,QAAA,GAAA,SAAA,CAAA,iBAAA,CAAA,IAAA,CAAA,SAAA,CAAA,kBAAA,EAAA,qBAAA,CAAA,CAAA;;;;AAIG,YAAA,QAAA,EAAA,IAAA,CAAA,MAAA,CAAA,WAAA,CAAA,QAAA;AACH,YAAQ,SAAe,EAAA,OAAA,CAAA,SAAA;AAiCvB,YAAA,MAAA,EAAA,OAAA,CAAA,MAAA;;;;;AAKG,YAAA,SAAA,EAAA,OAAA,CAAA,SAAA;YACW,MAA0B,EAAA,OAAA,CAAA,MAAA;AAqFxC,SAAA,CAAA;;;;AAIG;AACH;AAqCH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { AuthenticationResult, IAppTokenProvider, Logger } from "@azure/msal-common";
|
|
2
|
-
import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest";
|
|
3
|
-
import { AuthorizationUrlRequest } from "../request/AuthorizationUrlRequest";
|
|
4
|
-
import { ClientCredentialRequest } from "../request/ClientCredentialRequest";
|
|
5
|
-
import { OnBehalfOfRequest } from "../request/OnBehalfOfRequest";
|
|
6
|
-
import { RefreshTokenRequest } from "../request/RefreshTokenRequest";
|
|
7
|
-
import { SilentFlowRequest } from "../request/SilentFlowRequest";
|
|
8
|
-
import { UsernamePasswordRequest } from "../request/UsernamePasswordRequest";
|
|
9
|
-
import { TokenCache } from "../cache/TokenCache";
|
|
2
|
+
import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest.js";
|
|
3
|
+
import { AuthorizationUrlRequest } from "../request/AuthorizationUrlRequest.js";
|
|
4
|
+
import { ClientCredentialRequest } from "../request/ClientCredentialRequest.js";
|
|
5
|
+
import { OnBehalfOfRequest } from "../request/OnBehalfOfRequest.js";
|
|
6
|
+
import { RefreshTokenRequest } from "../request/RefreshTokenRequest.js";
|
|
7
|
+
import { SilentFlowRequest } from "../request/SilentFlowRequest.js";
|
|
8
|
+
import { UsernamePasswordRequest } from "../request/UsernamePasswordRequest.js";
|
|
9
|
+
import { TokenCache } from "../cache/TokenCache.js";
|
|
10
10
|
/**
|
|
11
11
|
* Interface for the ConfidentialClientApplication class defining the public API signatures
|
|
12
12
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IConfidentialClientApplication.d.ts","sourceRoot":"","sources":["../../src/client/IConfidentialClientApplication.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,oBAAoB,EACpB,iBAAiB,EACjB,MAAM,EACT,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,wBAAwB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"IConfidentialClientApplication.d.ts","sourceRoot":"","sources":["../../src/client/IConfidentialClientApplication.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,oBAAoB,EACpB,iBAAiB,EACjB,MAAM,EACT,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAC3C,mDAAmD;IACnD,cAAc,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAElE,+HAA+H;IAC/H,kBAAkB,CACd,OAAO,EAAE,wBAAwB,GAClC,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAEjC,8FAA8F;IAC9F,kBAAkB,CACd,OAAO,EAAE,iBAAiB,GAC3B,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IAExC,wFAAwF;IACxF,0BAA0B,CACtB,OAAO,EAAE,mBAAmB,GAC7B,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IAExC,mFAAmF;IACnF,8BAA8B,CAC1B,OAAO,EAAE,uBAAuB,GACjC,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IAExC,6DAA6D;IAC7D,sBAAsB,CAClB,OAAO,EAAE,iBAAiB,GAC3B,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IAExC,kHAAkH;IAClH,8BAA8B,CAC1B,OAAO,EAAE,uBAAuB,GACjC,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IAExC,+CAA+C;IAC/C,aAAa,IAAI,UAAU,CAAC;IAE5B,kCAAkC;IAClC,SAAS,IAAI,MAAM,CAAC;IAEpB,gGAAgG;IAChG,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC,sBAAsB;IACtB,UAAU,IAAI,IAAI,CAAC;IAEnB,0FAA0F;IAC1F,mBAAmB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAC;CAC1D"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { AccountInfo, AuthenticationResult, Logger } from "@azure/msal-common";
|
|
2
|
-
import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest";
|
|
3
|
-
import { AuthorizationUrlRequest } from "../request/AuthorizationUrlRequest";
|
|
4
|
-
import { DeviceCodeRequest } from "../request/DeviceCodeRequest";
|
|
5
|
-
import { RefreshTokenRequest } from "../request/RefreshTokenRequest";
|
|
6
|
-
import { SilentFlowRequest } from "../request/SilentFlowRequest";
|
|
7
|
-
import { UsernamePasswordRequest } from "../request/UsernamePasswordRequest";
|
|
8
|
-
import { TokenCache } from "../cache/TokenCache";
|
|
9
|
-
import { InteractiveRequest } from "../request/InteractiveRequest";
|
|
10
|
-
import { SignOutRequest } from "../request/SignOutRequest";
|
|
2
|
+
import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest.js";
|
|
3
|
+
import { AuthorizationUrlRequest } from "../request/AuthorizationUrlRequest.js";
|
|
4
|
+
import { DeviceCodeRequest } from "../request/DeviceCodeRequest.js";
|
|
5
|
+
import { RefreshTokenRequest } from "../request/RefreshTokenRequest.js";
|
|
6
|
+
import { SilentFlowRequest } from "../request/SilentFlowRequest.js";
|
|
7
|
+
import { UsernamePasswordRequest } from "../request/UsernamePasswordRequest.js";
|
|
8
|
+
import { TokenCache } from "../cache/TokenCache.js";
|
|
9
|
+
import { InteractiveRequest } from "../request/InteractiveRequest.js";
|
|
10
|
+
import { SignOutRequest } from "../request/SignOutRequest.js";
|
|
11
11
|
/**
|
|
12
12
|
* Interface for the PublicClientApplication class defining the public API signatures
|
|
13
13
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IPublicClientApplication.d.ts","sourceRoot":"","sources":["../../src/client/IPublicClientApplication.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"IPublicClientApplication.d.ts","sourceRoot":"","sources":["../../src/client/IPublicClientApplication.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACrC,mDAAmD;IACnD,cAAc,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAElE,8HAA8H;IAC9H,kBAAkB,CACd,OAAO,EAAE,wBAAwB,GAClC,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAEjC,qCAAqC;IACrC,uBAAuB,CACnB,OAAO,EAAE,kBAAkB,GAC5B,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAEjC,6FAA6F;IAC7F,kBAAkB,CACd,OAAO,EAAE,iBAAiB,GAC3B,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAEjC,wFAAwF;IACxF,0BAA0B,CACtB,OAAO,EAAE,mBAAmB,GAC7B,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IAExC,0EAA0E;IAC1E,wBAAwB,CACpB,OAAO,EAAE,iBAAiB,GAC3B,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IAExC,kHAAkH;IAClH,8BAA8B,CAC1B,OAAO,EAAE,uBAAuB,GACjC,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IAExC,+CAA+C;IAC/C,aAAa,IAAI,UAAU,CAAC;IAE5B,kCAAkC;IAClC,SAAS,IAAI,MAAM,CAAC;IAEpB,gGAAgG;IAChG,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC,sBAAsB;IACtB,UAAU,IAAI,IAAI,CAAC;IAEnB,+BAA+B;IAC/B,cAAc,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAEzC,gEAAgE;IAChE,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnD"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
/*! @azure/msal-node v2.0
|
|
1
|
+
/*! @azure/msal-node v2.1.0 2023-09-05 */
|
|
2
2
|
'use strict';
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
5
|
var msalCommon = require('@azure/msal-common');
|
|
6
|
+
var EncodingUtils = require('../utils/EncodingUtils.cjs');
|
|
6
7
|
|
|
7
8
|
/*
|
|
8
9
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -59,13 +60,11 @@ class OnBehalfOfClient extends msalCommon.BaseClient {
|
|
|
59
60
|
}
|
|
60
61
|
// fetch the idToken from cache
|
|
61
62
|
const cachedIdToken = this.readIdTokenFromCacheForOBO(cachedAccessToken.homeAccountId);
|
|
62
|
-
let
|
|
63
|
+
let idTokenClaims;
|
|
63
64
|
let cachedAccount = null;
|
|
64
65
|
if (cachedIdToken) {
|
|
65
|
-
|
|
66
|
-
const localAccountId =
|
|
67
|
-
? idTokenObject.claims.oid
|
|
68
|
-
: idTokenObject.claims.sub;
|
|
66
|
+
idTokenClaims = msalCommon.AuthToken.extractTokenClaims(cachedIdToken.secret, EncodingUtils.EncodingUtils.base64Decode);
|
|
67
|
+
const localAccountId = idTokenClaims.oid || idTokenClaims.sub;
|
|
69
68
|
const accountInfo = {
|
|
70
69
|
homeAccountId: cachedIdToken.homeAccountId,
|
|
71
70
|
environment: cachedIdToken.environment,
|
|
@@ -85,7 +84,7 @@ class OnBehalfOfClient extends msalCommon.BaseClient {
|
|
|
85
84
|
idToken: cachedIdToken,
|
|
86
85
|
refreshToken: null,
|
|
87
86
|
appMetadata: null,
|
|
88
|
-
}, true, request,
|
|
87
|
+
}, true, request, idTokenClaims);
|
|
89
88
|
}
|
|
90
89
|
/**
|
|
91
90
|
* read idtoken from cache, this is a specific implementation for OBO as the requirements differ from a generic lookup in the cacheManager
|
|
@@ -165,7 +164,7 @@ class OnBehalfOfClient extends msalCommon.BaseClient {
|
|
|
165
164
|
sshKid: request.sshKid,
|
|
166
165
|
};
|
|
167
166
|
const reqTimestamp = msalCommon.TimeUtils.nowSeconds();
|
|
168
|
-
const response = await this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint);
|
|
167
|
+
const response = await this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint, request.correlationId);
|
|
169
168
|
const responseHandler = new msalCommon.ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin);
|
|
170
169
|
responseHandler.validateTokenResponse(response.body);
|
|
171
170
|
const tokenResponse = await responseHandler.handleServerTokenResponse(response.body, this.authority, reqTimestamp, request, undefined, userAssertionHash);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnBehalfOfClient.cjs","sources":["../../src/client/OnBehalfOfClient.ts"],"sourcesContent":[null],"names":["
|
|
1
|
+
{"version":3,"file":"OnBehalfOfClient.cjs","sources":["../../src/client/OnBehalfOfClient.ts"],"sourcesContent":[null],"names":["CacheOutcome"],"mappings":";;;;;;;AAKA;AA6BA;;AAEG;;AAKa;AAIZ;;;AAGG,QAAA,KAAA,CAAA,aAAA,CAAA,CAAA;KACsB;AA8BzB;;;;;;;AAOG,QAAA,IAAA,CAAA,iBAAA,GAAA,MAAA,IAAA,CAAA,WAAA,CAAA,UAAA,CAAA,OAAA,CAAA,YAAA,CAAA,CAAA;YACW,OAA6B,CAAA,SAAA,EAAA;AA6E3C,YAAA,OAAA,MAAA,IAAA,CAAA,mBAAA,CAAA,OAAA,EAAA,IAAA,CAAA,SAAA,EAAA,IAAA,CAAA,iBAAA,CAAA,CAAA;;;;AAIG,SAAA;AACH,QAAA,OAAkC,CAAA,EAAA;AAsBlC;;;;;AAKG;AACH;AAwCA;;;;AAIG;uCAC8B,CAAA,OAAA,EAAA;AAwDjC;;;AAGG;AACH,YAAQ,IAAsB,CAAA,sBAAA,EAAA,eAAA,CAAAA,uBAAA,CAAA,sBAAA,CAAA,CAAA;AA0DjC,YAAA,IAAA,CAAA,MAAA,CAAA,IAAA,CAAA,gGAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -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,EAa1B,MAAM,oBAAoB,CAAC;AAG5B;;GAEG;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;IA6E3C;;;;OAIG;IACH,OAAO,CAAC,0BAA0B;IAsBlC;;;;;OAKG;IACH,OAAO,CAAC,8BAA8B;IAwCtC;;;;OAIG;YACW,mBAAmB;IAwDjC;;;OAGG;IACH,OAAO,CAAC,sBAAsB;CA0DjC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
/*! @azure/msal-node v2.0
|
|
1
|
+
/*! @azure/msal-node v2.1.0 2023-09-05 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { BaseClient, ScopeSet, CacheOutcome, ClientAuthError, TimeUtils, AuthToken, ResponseHandler, AuthenticationScheme, CredentialType, UrlString, RequestParameterBuilder, GrantType, AADServerParamKeys, Constants } from '@azure/msal-common';
|
|
4
|
+
import { EncodingUtils } from '../utils/EncodingUtils.mjs';
|
|
4
5
|
|
|
5
6
|
/*
|
|
6
7
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -57,13 +58,11 @@ class OnBehalfOfClient extends BaseClient {
|
|
|
57
58
|
}
|
|
58
59
|
// fetch the idToken from cache
|
|
59
60
|
const cachedIdToken = this.readIdTokenFromCacheForOBO(cachedAccessToken.homeAccountId);
|
|
60
|
-
let
|
|
61
|
+
let idTokenClaims;
|
|
61
62
|
let cachedAccount = null;
|
|
62
63
|
if (cachedIdToken) {
|
|
63
|
-
|
|
64
|
-
const localAccountId =
|
|
65
|
-
? idTokenObject.claims.oid
|
|
66
|
-
: idTokenObject.claims.sub;
|
|
64
|
+
idTokenClaims = AuthToken.extractTokenClaims(cachedIdToken.secret, EncodingUtils.base64Decode);
|
|
65
|
+
const localAccountId = idTokenClaims.oid || idTokenClaims.sub;
|
|
67
66
|
const accountInfo = {
|
|
68
67
|
homeAccountId: cachedIdToken.homeAccountId,
|
|
69
68
|
environment: cachedIdToken.environment,
|
|
@@ -83,7 +82,7 @@ class OnBehalfOfClient extends BaseClient {
|
|
|
83
82
|
idToken: cachedIdToken,
|
|
84
83
|
refreshToken: null,
|
|
85
84
|
appMetadata: null,
|
|
86
|
-
}, true, request,
|
|
85
|
+
}, true, request, idTokenClaims);
|
|
87
86
|
}
|
|
88
87
|
/**
|
|
89
88
|
* read idtoken from cache, this is a specific implementation for OBO as the requirements differ from a generic lookup in the cacheManager
|
|
@@ -163,7 +162,7 @@ class OnBehalfOfClient extends BaseClient {
|
|
|
163
162
|
sshKid: request.sshKid,
|
|
164
163
|
};
|
|
165
164
|
const reqTimestamp = TimeUtils.nowSeconds();
|
|
166
|
-
const response = await this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint);
|
|
165
|
+
const response = await this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint, request.correlationId);
|
|
167
166
|
const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin);
|
|
168
167
|
responseHandler.validateTokenResponse(response.body);
|
|
169
168
|
const tokenResponse = await responseHandler.handleServerTokenResponse(response.body, this.authority, reqTimestamp, request, undefined, userAssertionHash);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnBehalfOfClient.mjs","sources":["../../src/client/OnBehalfOfClient.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OnBehalfOfClient.mjs","sources":["../../src/client/OnBehalfOfClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAKA;AA6BA;;AAEG;;AAKa;AAIZ;;;AAGG,QAAA,KAAA,CAAA,aAAA,CAAA,CAAA;KACsB;AA8BzB;;;;;;;AAOG,QAAA,IAAA,CAAA,iBAAA,GAAA,MAAA,IAAA,CAAA,WAAA,CAAA,UAAA,CAAA,OAAA,CAAA,YAAA,CAAA,CAAA;YACW,OAA6B,CAAA,SAAA,EAAA;AA6E3C,YAAA,OAAA,MAAA,IAAA,CAAA,mBAAA,CAAA,OAAA,EAAA,IAAA,CAAA,SAAA,EAAA,IAAA,CAAA,iBAAA,CAAA,CAAA;;;;AAIG,SAAA;AACH,QAAA,OAAkC,CAAA,EAAA;AAsBlC;;;;;AAKG;AACH;AAwCA;;;;AAIG;uCAC8B,CAAA,OAAA,EAAA;AAwDjC;;;AAGG;AACH,YAAQ,IAAsB,CAAA,sBAAA,EAAA,eAAA,CAAA,YAAA,CAAA,sBAAA,CAAA,CAAA;AA0DjC,YAAA,IAAA,CAAA,MAAA,CAAA,IAAA,CAAA,gGAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-node v2.0
|
|
1
|
+
/*! @azure/msal-node v2.1.0 2023-09-05 */
|
|
2
2
|
'use strict';
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -100,36 +100,43 @@ class PublicClientApplication extends ClientApplication.ClientApplication {
|
|
|
100
100
|
}
|
|
101
101
|
const { verifier, challenge } = await this.cryptoProvider.generatePkceCodes();
|
|
102
102
|
const loopbackClient = customLoopbackClient || new LoopbackClient.LoopbackClient();
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
103
|
+
let authCodeListener;
|
|
104
|
+
try {
|
|
105
|
+
authCodeListener = loopbackClient.listenForAuthCode(successTemplate, errorTemplate);
|
|
106
|
+
const redirectUri = loopbackClient.getRedirectUri();
|
|
107
|
+
const validRequest = {
|
|
108
|
+
...remainingProperties,
|
|
109
|
+
correlationId: correlationId,
|
|
110
|
+
scopes: request.scopes || msalCommon.OIDC_DEFAULT_SCOPES,
|
|
111
|
+
redirectUri: redirectUri,
|
|
112
|
+
responseMode: msalCommon.ResponseMode.QUERY,
|
|
113
|
+
codeChallenge: challenge,
|
|
114
|
+
codeChallengeMethod: msalCommon.CodeChallengeMethodValues.S256,
|
|
115
|
+
};
|
|
116
|
+
const authCodeUrl = await this.getAuthCodeUrl(validRequest);
|
|
117
|
+
await openBrowser(authCodeUrl);
|
|
118
|
+
const authCodeResponse = await authCodeListener.finally(() => {
|
|
119
|
+
loopbackClient.closeServer();
|
|
120
|
+
});
|
|
121
|
+
if (authCodeResponse.error) {
|
|
122
|
+
throw new msalCommon.ServerError(authCodeResponse.error, authCodeResponse.error_description, authCodeResponse.suberror);
|
|
123
|
+
}
|
|
124
|
+
else if (!authCodeResponse.code) {
|
|
125
|
+
throw NodeAuthError.NodeAuthError.createNoAuthCodeInResponseError();
|
|
126
|
+
}
|
|
127
|
+
const clientInfo = authCodeResponse.client_info;
|
|
128
|
+
const tokenRequest = {
|
|
129
|
+
code: authCodeResponse.code,
|
|
130
|
+
codeVerifier: verifier,
|
|
131
|
+
clientInfo: clientInfo || msalCommon.Constants.EMPTY_STRING,
|
|
132
|
+
...validRequest,
|
|
133
|
+
};
|
|
134
|
+
return this.acquireTokenByCode(tokenRequest);
|
|
121
135
|
}
|
|
122
|
-
|
|
123
|
-
|
|
136
|
+
catch (e) {
|
|
137
|
+
loopbackClient.closeServer();
|
|
138
|
+
throw e;
|
|
124
139
|
}
|
|
125
|
-
const clientInfo = authCodeResponse.client_info;
|
|
126
|
-
const tokenRequest = {
|
|
127
|
-
code: authCodeResponse.code,
|
|
128
|
-
codeVerifier: verifier,
|
|
129
|
-
clientInfo: clientInfo || msalCommon.Constants.EMPTY_STRING,
|
|
130
|
-
...validRequest,
|
|
131
|
-
};
|
|
132
|
-
return this.acquireTokenByCode(tokenRequest);
|
|
133
140
|
}
|
|
134
141
|
/**
|
|
135
142
|
* Returns a token retrieved either from the cache or by exchanging the refresh token for a fresh access token. If brokering is enabled the token request will be serviced by the broker.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PublicClientApplication.cjs","sources":["../../src/client/PublicClientApplication.ts"],"sourcesContent":[null],"names":["ClientApplication","ApiId"
|
|
1
|
+
{"version":3,"file":"PublicClientApplication.cjs","sources":["../../src/client/PublicClientApplication.ts"],"sourcesContent":[null],"names":["ClientApplication","ApiId"],"mappings":";;;;;;;;;;;AAMA;AAeA;AACA;AACA;;;AAgBG;AACH;;AAKI,MAAA,uBAAA,SAAAA,mCAAA,CAAA;;;;;;;;;;;;;;;;AAgBG;AACS;AAgBZ,IAAA,WAAA,CAAA,aAAA,EAAA;;;;;;;;AAQG,gBAAA,IAAA,CAAA,MAAA,CAAA,OAAA,CAAA,yEAAA,CAAA,CAAA;aACkC;AAsCrC,SAAA;;AAEG;;AA0FH;;;;AAIG;;AA0BH;;;;AAIG,QAAA,MAAA,sBAAA,GAAA,IAAA,CAAA,gCAAA,CAAAC,eAAA,CAAA,wBAAA,EAAA,YAAA,CAAA,aAAA,CAAA,CAAA;QACU,IAAC;AAed,YAAA,MAAA,gBAAA,GAAA,MAAA,IAAA,CAAA,6BAAA,CAAA,YAAA,CAAA,SAAA,EAAA,YAAA,CAAA,aAAA,EAAA,sBAAA,EAAA,SAAA,EAAA,OAAA,CAAA,iBAAA,CAAA,CAAA;;;AAGG,YAAA,OAAA,gBAAA,CAAA,YAAA,CAAA,YAAA,CAAA,CAAA;AACG,SAAA;AAWT,QAAA,OAAA,CAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AuthenticationResult, AccountInfo } from "@azure/msal-common";
|
|
2
|
-
import { Configuration } from "../config/Configuration";
|
|
3
|
-
import { ClientApplication } from "./ClientApplication";
|
|
4
|
-
import { IPublicClientApplication } from "./IPublicClientApplication";
|
|
5
|
-
import { DeviceCodeRequest } from "../request/DeviceCodeRequest";
|
|
6
|
-
import { InteractiveRequest } from "../request/InteractiveRequest";
|
|
7
|
-
import { SilentFlowRequest } from "../request/SilentFlowRequest";
|
|
8
|
-
import { SignOutRequest } from "../request/SignOutRequest";
|
|
2
|
+
import { Configuration } from "../config/Configuration.js";
|
|
3
|
+
import { ClientApplication } from "./ClientApplication.js";
|
|
4
|
+
import { IPublicClientApplication } from "./IPublicClientApplication.js";
|
|
5
|
+
import { DeviceCodeRequest } from "../request/DeviceCodeRequest.js";
|
|
6
|
+
import { InteractiveRequest } from "../request/InteractiveRequest.js";
|
|
7
|
+
import { SilentFlowRequest } from "../request/SilentFlowRequest.js";
|
|
8
|
+
import { SignOutRequest } from "../request/SignOutRequest.js";
|
|
9
9
|
/**
|
|
10
10
|
* This class is to be used to acquire tokens for public client applications (desktop, mobile). Public client applications
|
|
11
11
|
* are not trusted to safely store application secrets, and therefore can only request tokens in the name of an user.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PublicClientApplication.d.ts","sourceRoot":"","sources":["../../src/client/PublicClientApplication.ts"],"names":[],"mappings":"AAMA,OAAO,EACH,oBAAoB,EAUpB,WAAW,
|
|
1
|
+
{"version":3,"file":"PublicClientApplication.d.ts","sourceRoot":"","sources":["../../src/client/PublicClientApplication.ts"],"names":[],"mappings":"AAMA,OAAO,EACH,oBAAoB,EAUpB,WAAW,EAGd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAGpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAGtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAI9D;;;;GAIG;AACH,qBAAa,uBACT,SAAQ,iBACR,YAAW,wBAAwB;IAEnC,OAAO,CAAC,kBAAkB,CAAC,CAAsB;IACjD;;;;;;;;;;;;;;;;OAgBG;gBACS,aAAa,EAAE,aAAa;IAgBxC;;;;;;;;OAQG;IACU,wBAAwB,CACjC,OAAO,EAAE,iBAAiB,GAC3B,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAoCvC;;OAEG;IACG,uBAAuB,CACzB,OAAO,EAAE,kBAAkB,GAC5B,OAAO,CAAC,oBAAoB,CAAC;IAuFhC;;;;OAIG;IACG,kBAAkB,CACpB,OAAO,EAAE,iBAAiB,GAC3B,OAAO,CAAC,oBAAoB,CAAC;IAuBhC;;;;OAIG;IACG,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAerD;;;OAGG;IACG,cAAc,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;CAWjD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @azure/msal-node v2.0
|
|
1
|
+
/*! @azure/msal-node v2.1.0 2023-09-05 */
|
|
2
2
|
'use strict';
|
|
3
|
-
import { ApiId, Constants } from '../utils/Constants.mjs';
|
|
4
|
-
import { AuthError,
|
|
3
|
+
import { ApiId, Constants as Constants$1 } from '../utils/Constants.mjs';
|
|
4
|
+
import { AuthError, OIDC_DEFAULT_SCOPES, ResponseMode, CodeChallengeMethodValues, ServerError, Constants } from '@azure/msal-common';
|
|
5
5
|
import { ClientApplication } from './ClientApplication.mjs';
|
|
6
6
|
import { NodeAuthError } from '../error/NodeAuthError.mjs';
|
|
7
7
|
import { LoopbackClient } from '../network/LoopbackClient.mjs';
|
|
@@ -85,7 +85,7 @@ class PublicClientApplication extends ClientApplication {
|
|
|
85
85
|
...remainingProperties,
|
|
86
86
|
clientId: this.config.auth.clientId,
|
|
87
87
|
scopes: request.scopes || OIDC_DEFAULT_SCOPES,
|
|
88
|
-
redirectUri: `${Constants.HTTP_PROTOCOL}${Constants.LOCALHOST}`,
|
|
88
|
+
redirectUri: `${Constants$1.HTTP_PROTOCOL}${Constants$1.LOCALHOST}`,
|
|
89
89
|
authority: request.authority || this.config.auth.authority,
|
|
90
90
|
correlationId: correlationId,
|
|
91
91
|
extraParameters: {
|
|
@@ -98,36 +98,43 @@ class PublicClientApplication extends ClientApplication {
|
|
|
98
98
|
}
|
|
99
99
|
const { verifier, challenge } = await this.cryptoProvider.generatePkceCodes();
|
|
100
100
|
const loopbackClient = customLoopbackClient || new LoopbackClient();
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
101
|
+
let authCodeListener;
|
|
102
|
+
try {
|
|
103
|
+
authCodeListener = loopbackClient.listenForAuthCode(successTemplate, errorTemplate);
|
|
104
|
+
const redirectUri = loopbackClient.getRedirectUri();
|
|
105
|
+
const validRequest = {
|
|
106
|
+
...remainingProperties,
|
|
107
|
+
correlationId: correlationId,
|
|
108
|
+
scopes: request.scopes || OIDC_DEFAULT_SCOPES,
|
|
109
|
+
redirectUri: redirectUri,
|
|
110
|
+
responseMode: ResponseMode.QUERY,
|
|
111
|
+
codeChallenge: challenge,
|
|
112
|
+
codeChallengeMethod: CodeChallengeMethodValues.S256,
|
|
113
|
+
};
|
|
114
|
+
const authCodeUrl = await this.getAuthCodeUrl(validRequest);
|
|
115
|
+
await openBrowser(authCodeUrl);
|
|
116
|
+
const authCodeResponse = await authCodeListener.finally(() => {
|
|
117
|
+
loopbackClient.closeServer();
|
|
118
|
+
});
|
|
119
|
+
if (authCodeResponse.error) {
|
|
120
|
+
throw new ServerError(authCodeResponse.error, authCodeResponse.error_description, authCodeResponse.suberror);
|
|
121
|
+
}
|
|
122
|
+
else if (!authCodeResponse.code) {
|
|
123
|
+
throw NodeAuthError.createNoAuthCodeInResponseError();
|
|
124
|
+
}
|
|
125
|
+
const clientInfo = authCodeResponse.client_info;
|
|
126
|
+
const tokenRequest = {
|
|
127
|
+
code: authCodeResponse.code,
|
|
128
|
+
codeVerifier: verifier,
|
|
129
|
+
clientInfo: clientInfo || Constants.EMPTY_STRING,
|
|
130
|
+
...validRequest,
|
|
131
|
+
};
|
|
132
|
+
return this.acquireTokenByCode(tokenRequest);
|
|
119
133
|
}
|
|
120
|
-
|
|
121
|
-
|
|
134
|
+
catch (e) {
|
|
135
|
+
loopbackClient.closeServer();
|
|
136
|
+
throw e;
|
|
122
137
|
}
|
|
123
|
-
const clientInfo = authCodeResponse.client_info;
|
|
124
|
-
const tokenRequest = {
|
|
125
|
-
code: authCodeResponse.code,
|
|
126
|
-
codeVerifier: verifier,
|
|
127
|
-
clientInfo: clientInfo || Constants$1.EMPTY_STRING,
|
|
128
|
-
...validRequest,
|
|
129
|
-
};
|
|
130
|
-
return this.acquireTokenByCode(tokenRequest);
|
|
131
138
|
}
|
|
132
139
|
/**
|
|
133
140
|
* Returns a token retrieved either from the cache or by exchanging the refresh token for a fresh access token. If brokering is enabled the token request will be serviced by the broker.
|
|
@@ -142,7 +149,7 @@ class PublicClientApplication extends ClientApplication {
|
|
|
142
149
|
...request,
|
|
143
150
|
clientId: this.config.auth.clientId,
|
|
144
151
|
scopes: request.scopes || OIDC_DEFAULT_SCOPES,
|
|
145
|
-
redirectUri: `${Constants.HTTP_PROTOCOL}${Constants.LOCALHOST}`,
|
|
152
|
+
redirectUri: `${Constants$1.HTTP_PROTOCOL}${Constants$1.LOCALHOST}`,
|
|
146
153
|
authority: request.authority || this.config.auth.authority,
|
|
147
154
|
correlationId: correlationId,
|
|
148
155
|
extraParameters: request.tokenQueryParameters,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PublicClientApplication.mjs","sources":["../../src/client/PublicClientApplication.ts"],"sourcesContent":[null],"names":[
|
|
1
|
+
{"version":3,"file":"PublicClientApplication.mjs","sources":["../../src/client/PublicClientApplication.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;AAMA;AAeA;AACA;AACA;;;AAgBG;AACH;;AAKI,MAAA,uBAAA,SAAA,iBAAA,CAAA;;;;;;;;;;;;;;;;AAgBG;AACS;AAgBZ,IAAA,WAAA,CAAA,aAAA,EAAA;;;;;;;;AAQG,gBAAA,IAAA,CAAA,MAAA,CAAA,OAAA,CAAA,yEAAA,CAAA,CAAA;aACkC;AAsCrC,SAAA;;AAEG;;AA0FH;;;;AAIG;;AA0BH;;;;AAIG,QAAA,MAAA,sBAAA,GAAA,IAAA,CAAA,gCAAA,CAAA,KAAA,CAAA,wBAAA,EAAA,YAAA,CAAA,aAAA,CAAA,CAAA;QACU,IAAC;AAed,YAAA,MAAA,gBAAA,GAAA,MAAA,IAAA,CAAA,6BAAA,CAAA,YAAA,CAAA,SAAA,EAAA,YAAA,CAAA,aAAA,EAAA,sBAAA,EAAA,SAAA,EAAA,OAAA,CAAA,iBAAA,CAAA,CAAA;;;AAGG,YAAA,OAAA,gBAAA,CAAA,YAAA,CAAA,YAAA,CAAA,CAAA;AACG,SAAA;AAWT,QAAA,OAAA,CAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-node v2.0
|
|
1
|
+
/*! @azure/msal-node v2.1.0 2023-09-05 */
|
|
2
2
|
'use strict';
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -55,7 +55,7 @@ class UsernamePasswordClient extends msalCommon.BaseClient {
|
|
|
55
55
|
shrClaims: request.shrClaims,
|
|
56
56
|
sshKid: request.sshKid,
|
|
57
57
|
};
|
|
58
|
-
return this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint);
|
|
58
|
+
return this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint, request.correlationId);
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
61
|
* Generates a map for all the params to be sent to the service
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UsernamePasswordClient.cjs","sources":["../../src/client/UsernamePasswordClient.ts"],"sourcesContent":[null],"names":["
|
|
1
|
+
{"version":3,"file":"UsernamePasswordClient.cjs","sources":["../../src/client/UsernamePasswordClient.ts"],"sourcesContent":[null],"names":["ResponseHandler"],"mappings":";;;;;;AAKA;AAkBA;;;AAIA;AACgB;AAIZ;;;;AAIG,QAAA,KAAA,CAAA,aAAA,CAAA,CAAA;KACe;AAgClB;;;;AAIG;sBAC8B,CAAA,OAAA,EAAA;AAmCjC,QAAA,IAAA,CAAA,MAAA,CAAA,IAAA,CAAA,kDAAA,CAAA,CAAA;;;AAGG,QAAA,MAAA,eAAA,GAAA,IAAAA,0BAAA,CAAA,IAAA,CAAA,MAAA,CAAA,WAAA,CAAA,QAAA,EAAA,IAAA,CAAA,YAAA,EAAA,IAAA,CAAA,WAAA,EAAA,IAAA,CAAA,MAAA,EAAA,IAAA,CAAA,MAAA,CAAA,iBAAA,EAAA,IAAA,CAAA,MAAA,CAAA,iBAAA,CAAA,CAAA;AACH;AAkEH,QAAA,eAAA,CAAA,qBAAA,CAAA,QAAA,CAAA,IAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UsernamePasswordClient.d.ts","sourceRoot":"","sources":["../../src/client/UsernamePasswordClient.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,oBAAoB,EAEpB,UAAU,EAEV,mBAAmB,EACnB,6BAA6B,EAUhC,MAAM,oBAAoB,CAAC;AAE5B;;;GAGG;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;
|
|
1
|
+
{"version":3,"file":"UsernamePasswordClient.d.ts","sourceRoot":"","sources":["../../src/client/UsernamePasswordClient.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,oBAAoB,EAEpB,UAAU,EAEV,mBAAmB,EACnB,6BAA6B,EAUhC,MAAM,oBAAoB,CAAC;AAE5B;;;GAGG;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;IACH,OAAO,CAAC,sBAAsB;CAkEjC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-node v2.0
|
|
1
|
+
/*! @azure/msal-node v2.1.0 2023-09-05 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { BaseClient, TimeUtils, ResponseHandler, UrlString, CcsCredentialType, RequestParameterBuilder, GrantType, StringUtils } from '@azure/msal-common';
|
|
4
4
|
|
|
@@ -53,7 +53,7 @@ class UsernamePasswordClient extends BaseClient {
|
|
|
53
53
|
shrClaims: request.shrClaims,
|
|
54
54
|
sshKid: request.sshKid,
|
|
55
55
|
};
|
|
56
|
-
return this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint);
|
|
56
|
+
return this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint, request.correlationId);
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
59
|
* Generates a map for all the params to be sent to the service
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UsernamePasswordClient.mjs","sources":["../../src/client/UsernamePasswordClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"UsernamePasswordClient.mjs","sources":["../../src/client/UsernamePasswordClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAKA;AAkBA;;;AAIA;AACgB;AAIZ;;;;AAIG,QAAA,KAAA,CAAA,aAAA,CAAA,CAAA;KACe;AAgClB;;;;AAIG;sBAC8B,CAAA,OAAA,EAAA;AAmCjC,QAAA,IAAA,CAAA,MAAA,CAAA,IAAA,CAAA,kDAAA,CAAA,CAAA;;;AAGG,QAAA,MAAA,eAAA,GAAA,IAAA,eAAA,CAAA,IAAA,CAAA,MAAA,CAAA,WAAA,CAAA,QAAA,EAAA,IAAA,CAAA,YAAA,EAAA,IAAA,CAAA,WAAA,EAAA,IAAA,CAAA,MAAA,EAAA,IAAA,CAAA,MAAA,CAAA,iBAAA,EAAA,IAAA,CAAA,MAAA,CAAA,iBAAA,CAAA,CAAA;AACH;AAkEH,QAAA,eAAA,CAAA,qBAAA,CAAA,QAAA,CAAA,IAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|