@azure/msal-node 1.9.1 → 1.12.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 +1 -3
- package/dist/client/ClientApplication.d.ts.map +1 -1
- package/dist/client/ConfidentialClientApplication.d.ts +9 -1
- package/dist/client/ConfidentialClientApplication.d.ts.map +1 -1
- package/dist/client/IConfidentialClientApplication.d.ts +3 -1
- package/dist/client/IConfidentialClientApplication.d.ts.map +1 -1
- package/dist/config/Configuration.d.ts +2 -0
- package/dist/config/Configuration.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/msal-node.cjs.development.js +45 -10
- package/dist/msal-node.cjs.development.js.map +1 -1
- package/dist/msal-node.cjs.production.min.js +1 -1
- package/dist/msal-node.cjs.production.min.js.map +1 -1
- package/dist/msal-node.esm.js +45 -10
- package/dist/msal-node.esm.js.map +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.d.ts.map +1 -1
- package/dist/request/ClientCredentialRequest.d.ts +3 -1
- package/dist/request/ClientCredentialRequest.d.ts.map +1 -1
- package/dist/request/RefreshTokenRequest.d.ts +3 -1
- package/dist/request/RefreshTokenRequest.d.ts.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -116,9 +116,7 @@ AAD samples:
|
|
|
116
116
|
|
|
117
117
|
B2C samples:
|
|
118
118
|
|
|
119
|
-
- [b2c-
|
|
120
|
-
- [b2c-auth-code-pkce](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples/b2c-auth-code-pkce): Express app using OAuth2.0 authorization code flow with PKCE.
|
|
121
|
-
- [b2c-silent-flow](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples/b2c-silent-flow): Express app using OAuth2.0 authorization code flow to acquire a token and store in the token cache, and silent flow to use tokens in the token cache.
|
|
119
|
+
- [b2c-user-flows](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples/b2c-user-flows): Express app using OAuth2.0 authorization code flow.
|
|
122
120
|
- [ms-identity-b2c-javascript-nodejs-management](https://github.com/Azure-Samples/ms-identity-b2c-javascript-nodejs-management/tree/main/Chapter2): Command line app using OAuth 2.0 client credentials flow for performing user management operations on an Azure AD / Azure AD B2C tenant
|
|
123
121
|
|
|
124
122
|
Others:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientApplication.d.ts","sourceRoot":"","sources":["../src/client/ClientApplication.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,mBAAmB,EAEnB,oBAAoB,EAGpB,eAAe,EAEf,MAAM,EACN,sBAAsB,EAYtB,wBAAwB,EAExB,iBAAiB,EACjB,wBAAwB,EAG3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAyB,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAElG,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAE7E;;;GAGG;AACH,8BAAsB,iBAAiB;IAEnC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAChD,OAAO,CAAC,UAAU,CAAa;IAE/B;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,WAAW,CAAC;IAC/B;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;I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AC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA8B1F;;;;;;;;;OASG;IACG,8BAA8B,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA2B5G;;OAEG;IACH,aAAa,IAAI,UAAU;IAK3B;;OAEG;IACH,SAAS,IAAI,MAAM;IAInB;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAI/B;;;;OAIG;cACa,6BAA6B,CACzC,SAAS,EAAE,MAAM,EACjB,oBAAoB,CAAC,EAAE,MAAM,EAC7B,sBAAsB,CAAC,EAAE,sBAAsB,EAC/C,wBAAwB,CAAC,EAAE,wBAAwB,EACnD,iBAAiB,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAoDxE,OAAO,CAAC,kBAAkB;IAO1B;;;OAGG;cACa,qBAAqB,CAAC,WAAW,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC;IAsBtG;;;;;OAKG;IACH,SAAS,CAAC,gCAAgC,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,sBAAsB;IAWhI;;;;OAIG;YACW,eAAe;IAkB7B;;OAEG;IACH,UAAU,IAAI,IAAI;CAGrB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ClientApplication } from "./ClientApplication";
|
|
2
2
|
import { Configuration } from "../config/Configuration";
|
|
3
|
-
import { AuthenticationResult } from "@azure/msal-common";
|
|
3
|
+
import { AuthenticationResult, IAppTokenProvider } from "@azure/msal-common";
|
|
4
4
|
import { IConfidentialClientApplication } from "./IConfidentialClientApplication";
|
|
5
5
|
import { OnBehalfOfRequest } from "../request/OnBehalfOfRequest";
|
|
6
6
|
import { ClientCredentialRequest } from "../request/ClientCredentialRequest";
|
|
@@ -10,6 +10,7 @@ import { ClientCredentialRequest } from "../request/ClientCredentialRequest";
|
|
|
10
10
|
* @public
|
|
11
11
|
*/
|
|
12
12
|
export declare class ConfidentialClientApplication extends ClientApplication implements IConfidentialClientApplication {
|
|
13
|
+
private appTokenProvider?;
|
|
13
14
|
/**
|
|
14
15
|
* Constructor for the ConfidentialClientApplication
|
|
15
16
|
*
|
|
@@ -30,6 +31,13 @@ export declare class ConfidentialClientApplication extends ClientApplication imp
|
|
|
30
31
|
* @param Configuration - configuration object for the MSAL ConfidentialClientApplication instance
|
|
31
32
|
*/
|
|
32
33
|
constructor(configuration: Configuration);
|
|
34
|
+
/**
|
|
35
|
+
* This extensibility point only works for the client_credential flow, i.e. acquireTokenByClientCredential and
|
|
36
|
+
* is meant for Azure SDK to enhance Managed Identity support.
|
|
37
|
+
*
|
|
38
|
+
* @param IAppTokenProvider - Extensibility interface, which allows the app developer to return a token from a custom source.
|
|
39
|
+
*/
|
|
40
|
+
SetAppTokenProvider(provider: IAppTokenProvider): void;
|
|
33
41
|
/**
|
|
34
42
|
* Acquires tokens from the authority for the application (not for an end user).
|
|
35
43
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfidentialClientApplication.d.ts","sourceRoot":"","sources":["../src/client/ConfidentialClientApplication.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,OAAO,EAKH,oBAAoB,
|
|
1
|
+
{"version":3,"file":"ConfidentialClientApplication.d.ts","sourceRoot":"","sources":["../src/client/ConfidentialClientApplication.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,OAAO,EAKH,oBAAoB,EAMpB,iBAAiB,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAE7E;;;;GAIG;AACH,qBAAa,6BAA8B,SAAQ,iBAAkB,YAAW,8BAA8B;IAE1G,OAAO,CAAC,gBAAgB,CAAC,CAAoB;IAE7C;;;;;;;;;;;;;;;;;;OAkBG;gBACS,aAAa,EAAE,aAAa;IAMxC;;;;;OAKG;IACH,mBAAmB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI;IAItD;;OAEG;IACU,8BAA8B,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA4CnH;;;;;;;;;;OAUG;IACU,sBAAsB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAyBrG,OAAO,CAAC,mBAAmB;CAyC9B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthenticationResult, Logger } from "@azure/msal-common";
|
|
1
|
+
import { AuthenticationResult, IAppTokenProvider, Logger } from "@azure/msal-common";
|
|
2
2
|
import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest";
|
|
3
3
|
import { AuthorizationUrlRequest } from "../request/AuthorizationUrlRequest";
|
|
4
4
|
import { ClientCredentialRequest } from "../request/ClientCredentialRequest";
|
|
@@ -34,5 +34,7 @@ export interface IConfidentialClientApplication {
|
|
|
34
34
|
setLogger(logger: Logger): void;
|
|
35
35
|
/** Clear the cache */
|
|
36
36
|
clearCache(): void;
|
|
37
|
+
/** This extensibility point is meant for Azure SDK to enhance Managed Identity support */
|
|
38
|
+
SetAppTokenProvider(provider: IAppTokenProvider): void;
|
|
37
39
|
}
|
|
38
40
|
//# sourceMappingURL=IConfidentialClientApplication.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IConfidentialClientApplication.d.ts","sourceRoot":"","sources":["../src/client/IConfidentialClientApplication.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"IConfidentialClientApplication.d.ts","sourceRoot":"","sources":["../src/client/IConfidentialClientApplication.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACrF,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAE3C,mDAAmD;IACnD,cAAc,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAElE,+HAA+H;IAC/H,kBAAkB,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IAE5F,8FAA8F;IAC9F,kBAAkB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IAErF,wFAAwF;IACxF,0BAA0B,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IAE/F,mFAAmF;IACnF,8BAA8B,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IAEvG,6DAA6D;IAC7D,sBAAsB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IAEzF,kHAAkH;IAClH,8BAA8B,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IAEvG,+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,CAAA;CACzD"}
|
|
@@ -7,6 +7,7 @@ import { LoggerOptions, INetworkModule, ProtocolMode, ICachePlugin, AzureCloudOp
|
|
|
7
7
|
* - clientAssertion - Assertion string that the application uses when requesting a token. Only used in confidential client applications. Assertion should be of type urn:ietf:params:oauth:client-assertion-type:jwt-bearer.
|
|
8
8
|
* - clientCertificate - Certificate that the application uses when requesting a token. Only used in confidential client applications. Requires hex encoded X.509 SHA-1 thumbprint of the certificiate, and the PEM encoded private key (string should contain -----BEGIN PRIVATE KEY----- ... -----END PRIVATE KEY----- )
|
|
9
9
|
* - protocolMode - Enum that represents the protocol that msal follows. Used for configuring proper endpoints.
|
|
10
|
+
* - skipAuthorityMetadataCache - A flag to choose whether to use or not use the local metadata cache during authority initialization. Defaults to false.
|
|
10
11
|
* @public
|
|
11
12
|
*/
|
|
12
13
|
export declare type NodeAuthOptions = {
|
|
@@ -25,6 +26,7 @@ export declare type NodeAuthOptions = {
|
|
|
25
26
|
clientCapabilities?: Array<string>;
|
|
26
27
|
protocolMode?: ProtocolMode;
|
|
27
28
|
azureCloudOptions?: AzureCloudOptions;
|
|
29
|
+
skipAuthorityMetadataCache?: boolean;
|
|
28
30
|
};
|
|
29
31
|
/**
|
|
30
32
|
* Use this to configure the below cache configuration options:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Configuration.d.ts","sourceRoot":"","sources":["../src/config/Configuration.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,aAAa,EACb,cAAc,EAEd,YAAY,EACZ,YAAY,EAGZ,iBAAiB,EACjB,oBAAoB,EACvB,MAAM,oBAAoB,CAAC;AAG5B
|
|
1
|
+
{"version":3,"file":"Configuration.d.ts","sourceRoot":"","sources":["../src/config/Configuration.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,aAAa,EACb,cAAc,EAEd,YAAY,EACZ,YAAY,EAGZ,iBAAiB,EACjB,oBAAoB,EACvB,MAAM,oBAAoB,CAAC;AAG5B;;;;;;;;;;GAUG;AACH,oBAAY,eAAe,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,GAAG,CAAC,EAAE,MAAM,CAAA;KACf,CAAC;IACF,gBAAgB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACjC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACnC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACxC,CAAC;AAEF;;;;;GAKG;AACH,oBAAY,YAAY,GAAG;IACvB,WAAW,CAAC,EAAE,YAAY,CAAC;CAC9B,CAAC;AAEF;;;;;;GAMG;AACH,oBAAY,iBAAiB,GAAG;IAC5B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,oBAAY,oBAAoB,GAAG;IAC/B,WAAW,CAAC,EAAE,oBAAoB,CAAC;CACtC,CAAC;AAEF;;;;;;;GAOG;AACH,oBAAY,aAAa,GAAG;IACxB,IAAI,EAAE,eAAe,CAAC;IACtB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,SAAS,CAAC,EAAE,oBAAoB,CAAC;CACpC,CAAC;AA+CF,oBAAY,iBAAiB,GAAG;IAC5B,IAAI,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;IAChC,KAAK,EAAE,YAAY,CAAC;IACpB,MAAM,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IACpC,SAAS,EAAE,QAAQ,CAAC,oBAAoB,CAAC,CAAC;CAC7C,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,EAClC,IAAI,EACJ,KAAK,EACL,MAAM,EACN,SAAS,EACZ,EAAE,aAAa,GAAG,iBAAiB,CAQnC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -25,6 +25,6 @@ export type { OnBehalfOfRequest } from "./request/OnBehalfOfRequest";
|
|
|
25
25
|
export type { UsernamePasswordRequest } from "./request/UsernamePasswordRequest";
|
|
26
26
|
export type { RefreshTokenRequest } from "./request/RefreshTokenRequest";
|
|
27
27
|
export type { SilentFlowRequest } from "./request/SilentFlowRequest";
|
|
28
|
-
export { PromptValue, ResponseMode, AuthorizationCodePayload, AuthenticationResult, AccountInfo, ValidCacheType, AuthError, AuthErrorMessage, ClientAuthError, ClientAuthErrorMessage, ClientConfigurationError, ClientConfigurationErrorMessage, InteractionRequiredAuthError, InteractionRequiredAuthErrorMessage, ServerError, INetworkModule, NetworkRequestOptions, NetworkResponse, Logger, LogLevel, ProtocolMode, ICachePlugin, TokenCacheContext, ISerializableTokenCache, AzureCloudInstance, AzureCloudOptions } from "@azure/msal-common";
|
|
28
|
+
export { PromptValue, ResponseMode, AuthorizationCodePayload, AuthenticationResult, AccountInfo, ValidCacheType, AuthError, AuthErrorMessage, ClientAuthError, ClientAuthErrorMessage, ClientConfigurationError, ClientConfigurationErrorMessage, InteractionRequiredAuthError, InteractionRequiredAuthErrorMessage, ServerError, INetworkModule, NetworkRequestOptions, NetworkResponse, Logger, LogLevel, ProtocolMode, ICachePlugin, TokenCacheContext, ISerializableTokenCache, AzureCloudInstance, AzureCloudOptions, IAppTokenProvider, AppTokenProviderParameters, AppTokenProviderResult } from "@azure/msal-common";
|
|
29
29
|
export { version } from "./packageMetadata";
|
|
30
30
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAKA;;;GAGG;AAGH,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAG1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,eAAe,EAAE,iBAAiB,EAAE,YAA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AAiB,EAAE,MAAM,6BAA6B,CAAC;AACrE,YAAY,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AACjF,YAAY,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACzE,YAAY,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAGrE,OAAO,EAEH,WAAW,EACX,YAAY,EACZ,wBAAwB,EAExB,oBAAoB,EAEpB,WAAW,EACX,cAAc,EAEd,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,wBAAwB,EACxB,+BAA+B,EAC/B,4BAA4B,EAC5B,mCAAmC,EACnC,WAAW,EAEX,cAAc,EACd,qBAAqB,EACrB,eAAe,EAEf,MAAM,EACN,QAAQ,EAER,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,uBAAuB,EAEvB,kBAAkB,EAClB,iBAAiB,EAEjB,iBAAiB,EACjB,0BAA0B,EAC1B,sBAAsB,EACzB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -362,7 +362,8 @@ const DEFAULT_AUTH_OPTIONS = {
|
|
|
362
362
|
azureCloudOptions: {
|
|
363
363
|
azureCloudInstance: msalCommon.AzureCloudInstance.None,
|
|
364
364
|
tenant: msalCommon.Constants.EMPTY_STRING
|
|
365
|
-
}
|
|
365
|
+
},
|
|
366
|
+
skipAuthorityMetadataCache: false
|
|
366
367
|
};
|
|
367
368
|
const DEFAULT_CACHE_OPTIONS = {};
|
|
368
369
|
const DEFAULT_LOGGER_OPTIONS = {
|
|
@@ -1757,7 +1758,7 @@ class TokenCache {
|
|
|
1757
1758
|
|
|
1758
1759
|
/* eslint-disable header/header */
|
|
1759
1760
|
const name = "@azure/msal-node";
|
|
1760
|
-
const version = "1.
|
|
1761
|
+
const version = "1.12.0";
|
|
1761
1762
|
|
|
1762
1763
|
/*
|
|
1763
1764
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1970,7 +1971,7 @@ class ClientApplication {
|
|
|
1970
1971
|
this.logger.verbose(`building oauth client configuration with the authority: ${authority}`, requestCorrelationId);
|
|
1971
1972
|
const discoveredAuthority = await this.createAuthority(authority, azureRegionConfiguration, requestCorrelationId, userAzureCloudOptions);
|
|
1972
1973
|
serverTelemetryManager == null ? void 0 : serverTelemetryManager.updateRegionDiscoveryMetadata(discoveredAuthority.regionDiscoveryMetadata);
|
|
1973
|
-
|
|
1974
|
+
const clientConfiguration = {
|
|
1974
1975
|
authOptions: {
|
|
1975
1976
|
clientId: this.config.auth.clientId,
|
|
1976
1977
|
authority: discoveredAuthority,
|
|
@@ -2003,6 +2004,7 @@ class ClientApplication {
|
|
|
2003
2004
|
persistencePlugin: this.config.cache.cachePlugin,
|
|
2004
2005
|
serializableCache: this.tokenCache
|
|
2005
2006
|
};
|
|
2007
|
+
return clientConfiguration;
|
|
2006
2008
|
}
|
|
2007
2009
|
|
|
2008
2010
|
getClientAssertion(authority) {
|
|
@@ -2069,7 +2071,8 @@ class ClientApplication {
|
|
|
2069
2071
|
knownAuthorities: this.config.auth.knownAuthorities,
|
|
2070
2072
|
cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,
|
|
2071
2073
|
authorityMetadata: this.config.auth.authorityMetadata,
|
|
2072
|
-
azureRegionConfiguration
|
|
2074
|
+
azureRegionConfiguration,
|
|
2075
|
+
skipAuthorityMetadataCache: this.config.auth.skipAuthorityMetadataCache
|
|
2073
2076
|
};
|
|
2074
2077
|
return await msalCommon.AuthorityFactory.createDiscoveredInstance(authorityUrl, this.config.system.networkClient, this.storage, authorityOptions, this.config.system.proxyUrl);
|
|
2075
2078
|
}
|
|
@@ -2318,6 +2321,18 @@ class ConfidentialClientApplication extends ClientApplication {
|
|
|
2318
2321
|
constructor(configuration) {
|
|
2319
2322
|
super(configuration);
|
|
2320
2323
|
this.setClientCredential(this.config);
|
|
2324
|
+
this.appTokenProvider = undefined;
|
|
2325
|
+
}
|
|
2326
|
+
/**
|
|
2327
|
+
* This extensibility point only works for the client_credential flow, i.e. acquireTokenByClientCredential and
|
|
2328
|
+
* is meant for Azure SDK to enhance Managed Identity support.
|
|
2329
|
+
*
|
|
2330
|
+
* @param IAppTokenProvider - Extensibility interface, which allows the app developer to return a token from a custom source.
|
|
2331
|
+
*/
|
|
2332
|
+
|
|
2333
|
+
|
|
2334
|
+
SetAppTokenProvider(provider) {
|
|
2335
|
+
this.appTokenProvider = provider;
|
|
2321
2336
|
}
|
|
2322
2337
|
/**
|
|
2323
2338
|
* Acquires tokens from the authority for the application (not for an end user).
|
|
@@ -2325,9 +2340,20 @@ class ConfidentialClientApplication extends ClientApplication {
|
|
|
2325
2340
|
|
|
2326
2341
|
|
|
2327
2342
|
async acquireTokenByClientCredential(request) {
|
|
2328
|
-
this.logger.info("acquireTokenByClientCredential called", request.correlationId);
|
|
2343
|
+
this.logger.info("acquireTokenByClientCredential called", request.correlationId); // If there is a client assertion present in the request, it overrides the one present in the client configuration
|
|
2344
|
+
|
|
2345
|
+
let clientAssertion;
|
|
2346
|
+
|
|
2347
|
+
if (request.clientAssertion) {
|
|
2348
|
+
clientAssertion = {
|
|
2349
|
+
assertion: request.clientAssertion,
|
|
2350
|
+
assertionType: Constants.JWT_BEARER_ASSERTION_TYPE
|
|
2351
|
+
};
|
|
2352
|
+
}
|
|
2353
|
+
|
|
2329
2354
|
const validRequest = { ...request,
|
|
2330
|
-
...(await this.initializeBaseRequest(request))
|
|
2355
|
+
...(await this.initializeBaseRequest(request)),
|
|
2356
|
+
clientAssertion
|
|
2331
2357
|
};
|
|
2332
2358
|
const azureRegionConfiguration = {
|
|
2333
2359
|
azureRegion: validRequest.azureRegion,
|
|
@@ -2337,7 +2363,7 @@ class ConfidentialClientApplication extends ClientApplication {
|
|
|
2337
2363
|
|
|
2338
2364
|
try {
|
|
2339
2365
|
const clientCredentialConfig = await this.buildOauthClientConfiguration(validRequest.authority, validRequest.correlationId, serverTelemetryManager, azureRegionConfiguration, request.azureCloudOptions);
|
|
2340
|
-
const clientCredentialClient = new msalCommon.ClientCredentialClient(clientCredentialConfig);
|
|
2366
|
+
const clientCredentialClient = new msalCommon.ClientCredentialClient(clientCredentialConfig, this.appTokenProvider);
|
|
2341
2367
|
this.logger.verbose("Client credential client created", validRequest.correlationId);
|
|
2342
2368
|
return clientCredentialClient.acquireToken(validRequest);
|
|
2343
2369
|
} catch (e) {
|
|
@@ -2369,8 +2395,8 @@ class ConfidentialClientApplication extends ClientApplication {
|
|
|
2369
2395
|
};
|
|
2370
2396
|
|
|
2371
2397
|
try {
|
|
2372
|
-
const
|
|
2373
|
-
const oboClient = new msalCommon.OnBehalfOfClient(
|
|
2398
|
+
const onBehalfOfConfig = await this.buildOauthClientConfiguration(validRequest.authority, validRequest.correlationId, undefined, undefined, request.azureCloudOptions);
|
|
2399
|
+
const oboClient = new msalCommon.OnBehalfOfClient(onBehalfOfConfig);
|
|
2374
2400
|
this.logger.verbose("On behalf of client created", validRequest.correlationId);
|
|
2375
2401
|
return oboClient.acquireToken(validRequest);
|
|
2376
2402
|
} catch (e) {
|
|
@@ -2389,7 +2415,16 @@ class ConfidentialClientApplication extends ClientApplication {
|
|
|
2389
2415
|
thumbprint: msalCommon.Constants.EMPTY_STRING,
|
|
2390
2416
|
privateKey: msalCommon.Constants.EMPTY_STRING
|
|
2391
2417
|
};
|
|
2392
|
-
const certificateNotEmpty = !msalCommon.StringUtils.isEmpty(certificate.thumbprint) || !msalCommon.StringUtils.isEmpty(certificate.privateKey);
|
|
2418
|
+
const certificateNotEmpty = !msalCommon.StringUtils.isEmpty(certificate.thumbprint) || !msalCommon.StringUtils.isEmpty(certificate.privateKey);
|
|
2419
|
+
/*
|
|
2420
|
+
* If app developer configures this callback, they don't need a credential
|
|
2421
|
+
* i.e. AzureSDK can get token from Managed Identity without a cert / secret
|
|
2422
|
+
*/
|
|
2423
|
+
|
|
2424
|
+
if (this.appTokenProvider) {
|
|
2425
|
+
return;
|
|
2426
|
+
} // Check that at most one credential is set on the application
|
|
2427
|
+
|
|
2393
2428
|
|
|
2394
2429
|
if (clientSecretNotEmpty && clientAssertionNotEmpty || clientAssertionNotEmpty && certificateNotEmpty || clientSecretNotEmpty && certificateNotEmpty) {
|
|
2395
2430
|
throw msalCommon.ClientAuthError.createInvalidCredentialError();
|