@azure/msal-browser 2.19.0 → 2.20.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/CHANGELOG.json +43 -0
- package/CHANGELOG.md +14 -1
- package/README.md +3 -1
- package/dist/_virtual/_tslib.js +1 -1
- package/dist/app/ClientApplication.d.ts +19 -0
- package/dist/app/ClientApplication.d.ts.map +1 -1
- package/dist/app/ClientApplication.js +76 -1
- package/dist/app/ClientApplication.js.map +1 -1
- package/dist/app/IPublicClientApplication.d.ts +2 -0
- package/dist/app/IPublicClientApplication.d.ts.map +1 -1
- package/dist/app/IPublicClientApplication.js +4 -1
- package/dist/app/IPublicClientApplication.js.map +1 -1
- package/dist/app/PublicClientApplication.js +1 -1
- package/dist/cache/AsyncMemoryStorage.d.ts +1 -1
- package/dist/cache/AsyncMemoryStorage.d.ts.map +1 -1
- package/dist/cache/AsyncMemoryStorage.js +2 -2
- package/dist/cache/AsyncMemoryStorage.js.map +1 -1
- package/dist/cache/BrowserCacheManager.js +1 -1
- package/dist/cache/BrowserStorage.js +1 -1
- package/dist/cache/DatabaseStorage.js +1 -1
- package/dist/cache/MemoryStorage.js +1 -1
- package/dist/cache/TokenCache.js +1 -1
- package/dist/config/Configuration.js +1 -1
- package/dist/crypto/BrowserCrypto.js +1 -1
- package/dist/crypto/CryptoOps.js +1 -1
- package/dist/crypto/GuidGenerator.js +1 -1
- package/dist/crypto/PkceGenerator.js +1 -1
- package/dist/crypto/SignedHttpRequest.js +1 -1
- package/dist/encode/Base64Decode.js +1 -1
- package/dist/encode/Base64Encode.js +1 -1
- package/dist/error/BrowserAuthError.d.ts +8 -0
- package/dist/error/BrowserAuthError.d.ts.map +1 -1
- package/dist/error/BrowserAuthError.js +11 -1
- package/dist/error/BrowserAuthError.js.map +1 -1
- package/dist/error/BrowserConfigurationAuthError.js +1 -1
- package/dist/event/EventHandler.js +1 -1
- package/dist/event/EventMessage.js +1 -1
- package/dist/event/EventType.d.ts +3 -0
- package/dist/event/EventType.d.ts.map +1 -1
- package/dist/event/EventType.js +4 -1
- package/dist/event/EventType.js.map +1 -1
- package/dist/index.cjs.js +300 -77
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/interaction_client/BaseInteractionClient.js +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.d.ts +5 -0
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.d.ts.map +1 -0
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +21 -0
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js.map +1 -0
- package/dist/interaction_client/PopupClient.js +2 -2
- package/dist/interaction_client/PopupClient.js.map +1 -1
- package/dist/interaction_client/RedirectClient.js +2 -2
- package/dist/interaction_client/RedirectClient.js.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.d.ts +22 -0
- package/dist/interaction_client/SilentAuthCodeClient.d.ts.map +1 -0
- package/dist/interaction_client/SilentAuthCodeClient.js +80 -0
- package/dist/interaction_client/SilentAuthCodeClient.js.map +1 -0
- package/dist/interaction_client/SilentCacheClient.js +1 -1
- package/dist/interaction_client/SilentIframeClient.js +2 -2
- package/dist/interaction_client/SilentIframeClient.js.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.js +1 -1
- package/dist/interaction_client/StandardInteractionClient.js +1 -1
- package/dist/interaction_handler/InteractionHandler.d.ts +11 -2
- package/dist/interaction_handler/InteractionHandler.d.ts.map +1 -1
- package/dist/interaction_handler/InteractionHandler.js +36 -10
- package/dist/interaction_handler/InteractionHandler.js.map +1 -1
- package/dist/interaction_handler/PopupHandler.js +1 -1
- package/dist/interaction_handler/RedirectHandler.d.ts +1 -1
- package/dist/interaction_handler/RedirectHandler.d.ts.map +1 -1
- package/dist/interaction_handler/RedirectHandler.js +2 -2
- package/dist/interaction_handler/RedirectHandler.js.map +1 -1
- package/dist/interaction_handler/SilentHandler.js +1 -1
- package/dist/navigation/NavigationClient.js +1 -1
- package/dist/network/FetchClient.js +1 -1
- package/dist/network/XhrClient.js +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.js +2 -2
- package/dist/packageMetadata.js.map +1 -1
- package/dist/request/AuthorizationCodeRequest.d.ts +8 -0
- package/dist/request/AuthorizationCodeRequest.d.ts.map +1 -0
- package/dist/utils/BrowserConstants.d.ts +1 -0
- package/dist/utils/BrowserConstants.d.ts.map +1 -1
- package/dist/utils/BrowserConstants.js +2 -1
- package/dist/utils/BrowserConstants.js.map +1 -1
- package/dist/utils/BrowserProtocolUtils.js +1 -1
- package/dist/utils/BrowserStringUtils.js +1 -1
- package/dist/utils/BrowserUtils.js +1 -1
- package/dist/utils/MathUtils.js +1 -1
- package/dist/utils/PopupUtils.js +1 -1
- package/lib/msal-browser.js +300 -77
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +27 -27
- package/package.json +3 -2
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,49 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure/msal-browser",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"date": "Tue, 07 Dec 2021 00:17:01 GMT",
|
|
6
|
+
"tag": "@azure/msal-browser_v2.20.0",
|
|
7
|
+
"version": "2.20.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"none": [
|
|
10
|
+
{
|
|
11
|
+
"author": "kamausamuel11@gmail.com",
|
|
12
|
+
"package": "@azure/msal-browser",
|
|
13
|
+
"commit": "8259de7520d2940d290332cd03c5b8babeb0966e",
|
|
14
|
+
"comment": "deps: run an audit fix on msal-browser"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "thomas.norling@microsoft.com",
|
|
18
|
+
"package": "@azure/msal-browser",
|
|
19
|
+
"commit": "02dbd9172368bfc69e4a47f01a3ada0b96345c81",
|
|
20
|
+
"comment": "Package.json updates"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"minor": [
|
|
24
|
+
{
|
|
25
|
+
"author": "janutter@microsoft.com",
|
|
26
|
+
"package": "@azure/msal-browser",
|
|
27
|
+
"commit": "4741b6c3a6a3dd58feefde93c095c05e1eca5e03",
|
|
28
|
+
"comment": "Add acquireTokenByCode API for hybrid spa flow #3978"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"author": "beachball",
|
|
32
|
+
"package": "@azure/msal-browser",
|
|
33
|
+
"comment": "Bump @azure/msal-common to v5.2.0",
|
|
34
|
+
"commit": "d7c209f7aa3ae4380a77a31ff1319fbf7201ae45"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"patch": [
|
|
38
|
+
{
|
|
39
|
+
"author": "hemoral@microsoft.com",
|
|
40
|
+
"package": "@azure/msal-browser",
|
|
41
|
+
"commit": "e983e25ba899bb437a135ec50ad6c77023c72e5b",
|
|
42
|
+
"comment": "Fix circular dependencies in AuthenticationHeaderParser and AsyncMemoryStorage #4235"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
},
|
|
4
47
|
{
|
|
5
48
|
"date": "Mon, 01 Nov 2021 23:53:21 GMT",
|
|
6
49
|
"tag": "@azure/msal-browser_v2.19.0",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
# Change Log - @azure/msal-browser
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 07 Dec 2021 00:17:01 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 2.20.0
|
|
8
|
+
|
|
9
|
+
Tue, 07 Dec 2021 00:17:01 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- Add acquireTokenByCode API for hybrid spa flow #3978 (janutter@microsoft.com)
|
|
14
|
+
- Bump @azure/msal-common to v5.2.0
|
|
15
|
+
|
|
16
|
+
### Patches
|
|
17
|
+
|
|
18
|
+
- Fix circular dependencies in AuthenticationHeaderParser and AsyncMemoryStorage #4235 (hemoral@microsoft.com)
|
|
19
|
+
|
|
7
20
|
## 2.19.0
|
|
8
21
|
|
|
9
22
|
Mon, 01 Nov 2021 23:53:21 GMT
|
package/README.md
CHANGED
|
@@ -59,7 +59,7 @@ npm install @azure/msal-browser
|
|
|
59
59
|
|
|
60
60
|
<!-- CDN_LATEST -->
|
|
61
61
|
```html
|
|
62
|
-
<script type="text/javascript" src="https://alcdn.msauth.net/browser/2.
|
|
62
|
+
<script type="text/javascript" src="https://alcdn.msauth.net/browser/2.20.0/js/msal-browser.min.js"></script>
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
See [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/cdn-usage.md) for more info on how to use this package from the Microsoft CDN.
|
|
@@ -109,6 +109,8 @@ Here is a complete list of samples for the MSAL.js 2.x library:
|
|
|
109
109
|
| [ssoSilent() Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples/VanillaJSTestApp2.0/app/ssoSilent) | A vanilla JS sample showing usage of the ssoSilent API, allowing you to sign in a user silently if a context exists on the authentication server. | `npm start -- -s ssoSilent` |
|
|
110
110
|
| [Internet Explorer 11 Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples/VanillaJSTestApp2.0/app/ie11-sample) | A vanilla JS sample showing usage of `@azure/msal-browser` in an application designed to run in Internet Explorer 11. | `npm start -- -s ie11-sample` |
|
|
111
111
|
| [Angular 10 Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-angular-v2-samples/angular10-browser-sample) | An Angular 10 sample showing usage of MSAL 2.0 with the Microsoft Graph API. | `npm start` |
|
|
112
|
+
| [Hybrid Spa Sample (w/ MSAL Node)](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples/HybridSample) | Sample demonstrating how to use `acquireTokenByCode` to perform SSO for applications that leverage server-side and client-side authentication using MSAL Browser and MSAL Node. | `npm start` |
|
|
113
|
+
| [Vue 3 Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples/vue3-sample-app) | A Vue 3 sample showing usage of MSAL 2.0 with the Microsoft Graph API. | `npm start` |
|
|
112
114
|
|
|
113
115
|
More instructions to run the samples can be found in the [`README.md` file](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/samples/msal-browser-samples/VanillaJSTestApp2.0/Readme.md) of the VanillaJSTestApp2.0 folder.
|
|
114
116
|
|
package/dist/_virtual/_tslib.js
CHANGED
|
@@ -11,6 +11,7 @@ import { EndSessionPopupRequest } from "../request/EndSessionPopupRequest";
|
|
|
11
11
|
import { INavigationClient } from "../navigation/INavigationClient";
|
|
12
12
|
import { EventHandler } from "../event/EventHandler";
|
|
13
13
|
import { ITokenCache } from "../cache/ITokenCache";
|
|
14
|
+
import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest";
|
|
14
15
|
export declare abstract class ClientApplication {
|
|
15
16
|
protected readonly browserCrypto: ICrypto;
|
|
16
17
|
protected readonly browserStorage: BrowserCacheManager;
|
|
@@ -22,6 +23,7 @@ export declare abstract class ClientApplication {
|
|
|
22
23
|
protected isBrowserEnvironment: boolean;
|
|
23
24
|
protected eventHandler: EventHandler;
|
|
24
25
|
private redirectResponse;
|
|
26
|
+
private hybridAuthCodeResponses;
|
|
25
27
|
/**
|
|
26
28
|
* @constructor
|
|
27
29
|
* Constructor for the PublicClientApplication used to instantiate the PublicClientApplication object
|
|
@@ -86,6 +88,23 @@ export declare abstract class ClientApplication {
|
|
|
86
88
|
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
|
|
87
89
|
*/
|
|
88
90
|
ssoSilent(request: SsoSilentRequest): Promise<AuthenticationResult>;
|
|
91
|
+
/**
|
|
92
|
+
* This function redeems an authorization code (passed as code) from the eSTS token endpoint.
|
|
93
|
+
* This authorization code should be acquired server-side using a confidential client to acquire a spa_code.
|
|
94
|
+
* This API is not indended for normal authorization code acquisition and redemption.
|
|
95
|
+
*
|
|
96
|
+
* Redemption of this authorization code will not require PKCE, as it was acquired by a confidential client.
|
|
97
|
+
*
|
|
98
|
+
* @param request {@link AuthorizationCodeRequest}
|
|
99
|
+
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
|
|
100
|
+
*/
|
|
101
|
+
acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult>;
|
|
102
|
+
/**
|
|
103
|
+
* Creates a SilentAuthCodeClient to redeem an authorization code.
|
|
104
|
+
* @param request
|
|
105
|
+
* @returns Result of the operation to redeem the authorization code
|
|
106
|
+
*/
|
|
107
|
+
private acquireTokenByCodeAsync;
|
|
89
108
|
/**
|
|
90
109
|
* Use this function to obtain a token before every call to the API / resource provider
|
|
91
110
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientApplication.d.ts","sourceRoot":"","sources":["../../src/app/ClientApplication.ts"],"names":[],"mappings":"AAMA,OAAO,EAA0D,WAAW,EAAa,cAAc,EAAE,oBAAoB,EAAE,MAAM,EAAE,uBAAuB,EAAE,OAAO,EAAiC,MAAM,oBAAoB,CAAC;AACnO,OAAO,EAAE,mBAAmB,EAAiC,MAAM,8BAA8B,CAAC;AAClG,OAAO,EAAE,oBAAoB,EAAsB,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAClG,OAAO,EAAE,eAAe,EAAiD,UAAU,EAAsB,MAAM,2BAA2B,CAAC;AAE3I,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OA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oB;CAK3C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.20.0 2021-12-07 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __awaiter, __generator } from '../_virtual/_tslib.js';
|
|
4
4
|
import { CryptoOps } from '../crypto/CryptoOps.js';
|
|
@@ -16,6 +16,8 @@ import { RedirectClient } from '../interaction_client/RedirectClient.js';
|
|
|
16
16
|
import { SilentIframeClient } from '../interaction_client/SilentIframeClient.js';
|
|
17
17
|
import { SilentRefreshClient } from '../interaction_client/SilentRefreshClient.js';
|
|
18
18
|
import { TokenCache } from '../cache/TokenCache.js';
|
|
19
|
+
import { SilentAuthCodeClient } from '../interaction_client/SilentAuthCodeClient.js';
|
|
20
|
+
import { BrowserAuthError } from '../error/BrowserAuthError.js';
|
|
19
21
|
|
|
20
22
|
/*
|
|
21
23
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -60,6 +62,8 @@ var ClientApplication = /** @class */ (function () {
|
|
|
60
62
|
this.navigationClient = this.config.system.navigationClient;
|
|
61
63
|
// Initialize redirectResponse Map
|
|
62
64
|
this.redirectResponse = new Map();
|
|
65
|
+
// Initial hybrid spa map
|
|
66
|
+
this.hybridAuthCodeResponses = new Map();
|
|
63
67
|
// Initialize the crypto class.
|
|
64
68
|
this.browserCrypto = this.isBrowserEnvironment ? new CryptoOps(this.logger) : DEFAULT_CRYPTO_IMPLEMENTATION;
|
|
65
69
|
this.eventHandler = new EventHandler(this.logger, this.browserCrypto);
|
|
@@ -264,6 +268,77 @@ var ClientApplication = /** @class */ (function () {
|
|
|
264
268
|
});
|
|
265
269
|
});
|
|
266
270
|
};
|
|
271
|
+
/**
|
|
272
|
+
* This function redeems an authorization code (passed as code) from the eSTS token endpoint.
|
|
273
|
+
* This authorization code should be acquired server-side using a confidential client to acquire a spa_code.
|
|
274
|
+
* This API is not indended for normal authorization code acquisition and redemption.
|
|
275
|
+
*
|
|
276
|
+
* Redemption of this authorization code will not require PKCE, as it was acquired by a confidential client.
|
|
277
|
+
*
|
|
278
|
+
* @param request {@link AuthorizationCodeRequest}
|
|
279
|
+
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
|
|
280
|
+
*/
|
|
281
|
+
ClientApplication.prototype.acquireTokenByCode = function (request) {
|
|
282
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
283
|
+
var response;
|
|
284
|
+
var _this = this;
|
|
285
|
+
return __generator(this, function (_a) {
|
|
286
|
+
this.preflightBrowserEnvironmentCheck(InteractionType.Silent);
|
|
287
|
+
this.logger.trace("acquireTokenByCode called", request.correlationId);
|
|
288
|
+
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_START, InteractionType.Silent, request);
|
|
289
|
+
try {
|
|
290
|
+
if (!request.code) {
|
|
291
|
+
throw BrowserAuthError.createAuthCodeRequiredError();
|
|
292
|
+
}
|
|
293
|
+
response = this.hybridAuthCodeResponses.get(request.code);
|
|
294
|
+
if (!response) {
|
|
295
|
+
this.logger.verbose("Initiating new acquireTokenByCode request", request.correlationId);
|
|
296
|
+
response = this.acquireTokenByCodeAsync(request)
|
|
297
|
+
.then(function (result) {
|
|
298
|
+
_this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_SUCCESS, InteractionType.Silent, result);
|
|
299
|
+
_this.hybridAuthCodeResponses.delete(request.code);
|
|
300
|
+
return result;
|
|
301
|
+
})
|
|
302
|
+
.catch(function (error) {
|
|
303
|
+
_this.hybridAuthCodeResponses.delete(request.code);
|
|
304
|
+
throw error;
|
|
305
|
+
});
|
|
306
|
+
this.hybridAuthCodeResponses.set(request.code, response);
|
|
307
|
+
}
|
|
308
|
+
else {
|
|
309
|
+
this.logger.verbose("Existing acquireTokenByCode request found", request.correlationId);
|
|
310
|
+
}
|
|
311
|
+
return [2 /*return*/, response];
|
|
312
|
+
}
|
|
313
|
+
catch (e) {
|
|
314
|
+
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE, InteractionType.Silent, null, e);
|
|
315
|
+
throw e;
|
|
316
|
+
}
|
|
317
|
+
return [2 /*return*/];
|
|
318
|
+
});
|
|
319
|
+
});
|
|
320
|
+
};
|
|
321
|
+
/**
|
|
322
|
+
* Creates a SilentAuthCodeClient to redeem an authorization code.
|
|
323
|
+
* @param request
|
|
324
|
+
* @returns Result of the operation to redeem the authorization code
|
|
325
|
+
*/
|
|
326
|
+
ClientApplication.prototype.acquireTokenByCodeAsync = function (request) {
|
|
327
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
328
|
+
var silentAuthCodeClient, silentTokenResult;
|
|
329
|
+
return __generator(this, function (_a) {
|
|
330
|
+
switch (_a.label) {
|
|
331
|
+
case 0:
|
|
332
|
+
this.logger.trace("acquireTokenByCodeAsync called", request.correlationId);
|
|
333
|
+
silentAuthCodeClient = new SilentAuthCodeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenByCode, request.correlationId);
|
|
334
|
+
return [4 /*yield*/, silentAuthCodeClient.acquireToken(request)];
|
|
335
|
+
case 1:
|
|
336
|
+
silentTokenResult = _a.sent();
|
|
337
|
+
return [2 /*return*/, silentTokenResult];
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
});
|
|
341
|
+
};
|
|
267
342
|
/**
|
|
268
343
|
* Use this function to obtain a token before every call to the API / resource provider
|
|
269
344
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientApplication.js","sources":["../../src/app/ClientApplication.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { CryptoOps } from \"../crypto/CryptoOps\";\nimport { StringUtils, ServerError, InteractionRequiredAuthError, AccountInfo, Constants, INetworkModule, AuthenticationResult, Logger, CommonSilentFlowRequest, ICrypto, DEFAULT_CRYPTO_IMPLEMENTATION } from \"@azure/msal-common\";\nimport { BrowserCacheManager, DEFAULT_BROWSER_CACHE_MANAGER } from \"../cache/BrowserCacheManager\";\nimport { BrowserConfiguration, buildConfiguration, Configuration } from \"../config/Configuration\";\nimport { InteractionType, ApiId, BrowserConstants, BrowserCacheLocation, WrapperSKU, TemporaryCacheKeys } from \"../utils/BrowserConstants\";\nimport { BrowserUtils } from \"../utils/BrowserUtils\";\nimport { RedirectRequest } from \"../request/RedirectRequest\";\nimport { PopupRequest } from \"../request/PopupRequest\";\nimport { SsoSilentRequest } from \"../request/SsoSilentRequest\";\nimport { version, name } from \"../packageMetadata\";\nimport { EventCallbackFunction } from \"../event/EventMessage\";\nimport { EventType } from \"../event/EventType\";\nimport { EndSessionRequest } from \"../request/EndSessionRequest\";\nimport { BrowserConfigurationAuthError } from \"../error/BrowserConfigurationAuthError\";\nimport { EndSessionPopupRequest } from \"../request/EndSessionPopupRequest\";\nimport { INavigationClient } from \"../navigation/INavigationClient\";\nimport { EventHandler } from \"../event/EventHandler\";\nimport { PopupClient } from \"../interaction_client/PopupClient\";\nimport { RedirectClient } from \"../interaction_client/RedirectClient\";\nimport { SilentIframeClient } from \"../interaction_client/SilentIframeClient\";\nimport { SilentRefreshClient } from \"../interaction_client/SilentRefreshClient\";\nimport { TokenCache } from \"../cache/TokenCache\";\nimport { ITokenCache } from \"../cache/ITokenCache\";\n\nexport abstract class ClientApplication {\n\n // Crypto interface implementation\n protected readonly browserCrypto: ICrypto;\n\n // Storage interface implementation\n protected readonly browserStorage: BrowserCacheManager;\n\n // Network interface implementation\n protected readonly networkClient: INetworkModule;\n\n // Navigation interface implementation\n protected navigationClient: INavigationClient;\n\n // Input configuration by developer/user\n protected config: BrowserConfiguration;\n\n // Token cache implementation\n private tokenCache: TokenCache;\n\n // Logger\n protected logger: Logger;\n\n // Flag to indicate if in browser environment\n protected isBrowserEnvironment: boolean;\n\n protected eventHandler: EventHandler;\n\n // Redirect Response Object\n private redirectResponse: Map<string, Promise<AuthenticationResult | null>>;\n\n /**\n * @constructor\n * Constructor for the PublicClientApplication used to instantiate the PublicClientApplication object\n *\n * Important attributes in the Configuration object for auth are:\n * - clientID: the application ID of your application. You can obtain one by registering your application with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview\n * - authority: the authority URL for your application.\n * - redirect_uri: the uri of your application registered in the portal.\n *\n * In Azure AD, authority is a URL indicating the Azure active directory that MSAL uses to obtain tokens.\n * It is of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}\n * If your application supports Accounts in one organizational directory, replace \"Enter_the_Tenant_Info_Here\" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).\n * If your application supports Accounts in any organizational directory, replace \"Enter_the_Tenant_Info_Here\" value with organizations.\n * If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace \"Enter_the_Tenant_Info_Here\" value with common.\n * To restrict support to Personal Microsoft accounts only, replace \"Enter_the_Tenant_Info_Here\" value with consumers.\n *\n * In Azure B2C, authority is of the form https://{instance}/tfp/{tenant}/{policyName}/\n * Full B2C functionality will be available in this library in future versions.\n *\n * @param configuration Object for the MSAL PublicClientApplication instance\n */\n constructor(configuration: Configuration) {\n /*\n * If loaded in an environment where window is not available,\n * set internal flag to false so that further requests fail.\n * This is to support server-side rendering environments.\n */\n this.isBrowserEnvironment = typeof window !== \"undefined\";\n // Set the configuration.\n this.config = buildConfiguration(configuration, this.isBrowserEnvironment);\n\n // Initialize logger\n this.logger = new Logger(this.config.system.loggerOptions, name, version);\n \n // Initialize the network module class.\n this.networkClient = this.config.system.networkClient;\n \n // Initialize the navigation client class.\n this.navigationClient = this.config.system.navigationClient;\n \n // Initialize redirectResponse Map\n this.redirectResponse = new Map();\n \n // Initialize the crypto class.\n this.browserCrypto = this.isBrowserEnvironment ? new CryptoOps(this.logger) : DEFAULT_CRYPTO_IMPLEMENTATION;\n\n this.eventHandler = new EventHandler(this.logger, this.browserCrypto);\n\n // Initialize the browser storage class.\n this.browserStorage = this.isBrowserEnvironment ? \n new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger) : \n DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger);\n\n // Initialize the token cache\n this.tokenCache = new TokenCache(this.config, this.browserStorage, this.logger, this.browserCrypto);\n }\n\n // #region Redirect Flow\n\n /**\n * Event handler function which allows users to fire events after the PublicClientApplication object\n * has loaded during redirect flows. This should be invoked on all page loads involved in redirect\n * auth flows.\n * @param hash Hash to process. Defaults to the current value of window.location.hash. Only needs to be provided explicitly if the response to be handled is not contained in the current value.\n * @returns Token response or null. If the return value is null, then no auth redirect was detected.\n */\n async handleRedirectPromise(hash?: string): Promise<AuthenticationResult | null> {\n this.logger.verbose(\"handleRedirectPromise called\");\n const loggedInAccounts = this.getAllAccounts();\n if (this.isBrowserEnvironment) {\n /**\n * Store the promise on the PublicClientApplication instance if this is the first invocation of handleRedirectPromise,\n * otherwise return the promise from the first invocation. Prevents race conditions when handleRedirectPromise is called\n * several times concurrently.\n */\n const redirectResponseKey = hash || Constants.EMPTY_STRING;\n let response = this.redirectResponse.get(redirectResponseKey);\n if (typeof response === \"undefined\") {\n this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_START, InteractionType.Redirect);\n this.logger.verbose(\"handleRedirectPromise has been called for the first time, storing the promise\");\n const correlationId = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.CORRELATION_ID, true) || \"\";\n const redirectClient = new RedirectClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, correlationId);\n response = redirectClient.handleRedirectPromise(hash)\n .then((result: AuthenticationResult | null) => {\n if (result) {\n // Emit login event if number of accounts change\n const isLoggingIn = loggedInAccounts.length < this.getAllAccounts().length;\n if (isLoggingIn) {\n this.eventHandler.emitEvent(EventType.LOGIN_SUCCESS, InteractionType.Redirect, result);\n this.logger.verbose(\"handleRedirectResponse returned result, login success\");\n } else {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Redirect, result);\n this.logger.verbose(\"handleRedirectResponse returned result, acquire token success\");\n }\n }\n this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_END, InteractionType.Redirect);\n\n return result;\n })\n .catch((e) => {\n // Emit login event if there is an account\n if (loggedInAccounts.length > 0) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Redirect, null, e);\n } else {\n this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, InteractionType.Redirect, null, e);\n }\n this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_END, InteractionType.Redirect);\n\n throw e;\n });\n this.redirectResponse.set(redirectResponseKey, response);\n } else {\n this.logger.verbose(\"handleRedirectPromise has been called previously, returning the result from the first call\");\n }\n \n return response;\n }\n this.logger.verbose(\"handleRedirectPromise returns null, not browser environment\");\n return null;\n }\n\n /**\n * Use when you want to obtain an access_token for your API by redirecting the user's browser window to the authorization endpoint. This function redirects\n * the page, so any code that follows this function will not execute.\n *\n * IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current\n * browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.\n *\n * @param request\n */\n async acquireTokenRedirect(request: RedirectRequest): Promise<void> {\n // Preflight request\n this.preflightBrowserEnvironmentCheck(InteractionType.Redirect);\n this.logger.verbose(\"acquireTokenRedirect called\");\n\n // If logged in, emit acquire token events\n const isLoggedIn = this.getAllAccounts().length > 0;\n if (isLoggedIn) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Redirect, request);\n } else {\n this.eventHandler.emitEvent(EventType.LOGIN_START, InteractionType.Redirect, request);\n }\n \n const redirectClient = new RedirectClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, request.correlationId);\n return redirectClient.acquireToken(request).catch((e) => {\n // If logged in, emit acquire token events\n if (isLoggedIn) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Redirect, null, e);\n } else {\n this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, InteractionType.Redirect, null, e);\n }\n throw e;\n });\n }\n\n // #endregion\n\n // #region Popup Flow\n\n /**\n * Use when you want to obtain an access_token for your API via opening a popup window in the user's browser\n *\n * @param request\n *\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n acquireTokenPopup(request: PopupRequest): Promise<AuthenticationResult> {\n try {\n this.preflightBrowserEnvironmentCheck(InteractionType.Popup);\n this.logger.verbose(\"acquireTokenPopup called\", request.correlationId);\n } catch (e) {\n // Since this function is syncronous we need to reject\n return Promise.reject(e);\n }\n\n // If logged in, emit acquire token events\n const loggedInAccounts = this.getAllAccounts();\n if (loggedInAccounts.length > 0) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Popup, request);\n } else {\n this.eventHandler.emitEvent(EventType.LOGIN_START, InteractionType.Popup, request);\n }\n\n const popupClient = new PopupClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, request.correlationId);\n\n return popupClient.acquireToken(request).then((result) => {\n // If logged in, emit acquire token events\n const isLoggingIn = loggedInAccounts.length < this.getAllAccounts().length;\n if (isLoggingIn) {\n this.eventHandler.emitEvent(EventType.LOGIN_SUCCESS, InteractionType.Popup, result);\n } else {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Popup, result);\n }\n\n return result;\n }).catch((e) => {\n if (loggedInAccounts.length > 0) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Popup, null, e);\n } else {\n this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, InteractionType.Popup, null, e);\n }\n // Since this function is syncronous we need to reject\n return Promise.reject(e);\n });\n }\n\n // #endregion\n\n // #region Silent Flow\n\n /**\n * This function uses a hidden iframe to fetch an authorization code from the eSTS. There are cases where this may not work:\n * - Any browser using a form of Intelligent Tracking Prevention\n * - If there is not an established session with the service\n *\n * In these cases, the request must be done inside a popup or full frame redirect.\n *\n * For the cases where interaction is required, you cannot send a request with prompt=none.\n *\n * If your refresh token has expired, you can use this function to fetch a new set of tokens silently as long as\n * you session on the server still exists.\n * @param request {@link SsoSilentRequest}\n *\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n async ssoSilent(request: SsoSilentRequest): Promise<AuthenticationResult> {\n this.preflightBrowserEnvironmentCheck(InteractionType.Silent);\n this.logger.verbose(\"ssoSilent called\", request.correlationId);\n this.eventHandler.emitEvent(EventType.SSO_SILENT_START, InteractionType.Silent, request);\n\n try {\n const silentIframeClient = new SilentIframeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.ssoSilent, request.correlationId);\n const silentTokenResult = await silentIframeClient.acquireToken(request);\n this.eventHandler.emitEvent(EventType.SSO_SILENT_SUCCESS, InteractionType.Silent, silentTokenResult);\n return silentTokenResult;\n } catch (e) {\n this.eventHandler.emitEvent(EventType.SSO_SILENT_FAILURE, InteractionType.Silent, null, e);\n throw e;\n }\n }\n\n /**\n * Use this function to obtain a token before every call to the API / resource provider\n *\n * MSAL return's a cached token when available\n * Or it send's a request to the STS to obtain a new token using a refresh token.\n *\n * @param {@link SilentRequest}\n *\n * To renew idToken, please pass clientId as the only scope in the Authentication Parameters\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n protected async acquireTokenByRefreshToken(request: CommonSilentFlowRequest): Promise<AuthenticationResult> {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_NETWORK_START, InteractionType.Silent, request);\n // block the reload if it occurred inside a hidden iframe\n BrowserUtils.blockReloadInHiddenIframes();\n\n const silentRefreshClient = new SilentRefreshClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, request.correlationId);\n\n return silentRefreshClient.acquireToken(request).catch(e => {\n const isServerError = e instanceof ServerError;\n const isInteractionRequiredError = e instanceof InteractionRequiredAuthError;\n const isInvalidGrantError = (e.errorCode === BrowserConstants.INVALID_GRANT_ERROR);\n if (isServerError && isInvalidGrantError && !isInteractionRequiredError) {\n this.logger.verbose(\"Refresh token expired or invalid, attempting acquire token by iframe\", request.correlationId);\n\n const silentIframeClient = new SilentIframeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenSilent_authCode, request.correlationId);\n return silentIframeClient.acquireToken(request);\n }\n throw e;\n });\n }\n\n // #endregion\n\n // #region Logout\n\n /**\n * Deprecated logout function. Use logoutRedirect or logoutPopup instead\n * @param logoutRequest \n * @deprecated\n */\n async logout(logoutRequest?: EndSessionRequest): Promise<void> {\n this.logger.warning(\"logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.\");\n return this.logoutRedirect(logoutRequest);\n }\n\n /**\n * Use to log out the current user, and redirect the user to the postLogoutRedirectUri.\n * Default behaviour is to redirect the user to `window.location.href`.\n * @param logoutRequest\n */\n async logoutRedirect(logoutRequest?: EndSessionRequest): Promise<void> {\n this.preflightBrowserEnvironmentCheck(InteractionType.Redirect);\n const redirectClient = new RedirectClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, logoutRequest?.correlationId);\n return redirectClient.logout(logoutRequest);\n }\n\n /**\n * Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server\n * @param logoutRequest \n */\n logoutPopup(logoutRequest?: EndSessionPopupRequest): Promise<void> {\n try{\n this.preflightBrowserEnvironmentCheck(InteractionType.Popup);\n const popupClient = new PopupClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, logoutRequest?.correlationId);\n return popupClient.logout(logoutRequest);\n } catch (e) {\n // Since this function is syncronous we need to reject\n return Promise.reject(e);\n }\n }\n\n // #endregion\n\n // #region Account APIs\n\n /**\n * Returns all accounts that MSAL currently has data for.\n * (the account object is created at the time of successful login)\n * or empty array when no accounts are found\n * @returns Array of account objects in cache\n */\n getAllAccounts(): AccountInfo[] {\n this.logger.verbose(\"getAllAccounts called\");\n return this.isBrowserEnvironment ? this.browserStorage.getAllAccounts() : [];\n }\n\n /**\n * Returns the signed in account matching username.\n * (the account object is created at the time of successful login)\n * or null when no matching account is found.\n * This API is provided for convenience but getAccountById should be used for best reliability\n * @param userName\n * @returns The account object stored in MSAL\n */\n getAccountByUsername(userName: string): AccountInfo|null {\n const allAccounts = this.getAllAccounts();\n if (!StringUtils.isEmpty(userName) && allAccounts && allAccounts.length) {\n this.logger.verbose(\"Account matching username found, returning\");\n this.logger.verbosePii(`Returning signed-in accounts matching username: ${userName}`);\n return allAccounts.filter(accountObj => accountObj.username.toLowerCase() === userName.toLowerCase())[0] || null;\n } else {\n this.logger.verbose(\"getAccountByUsername: No matching account found, returning null\");\n return null;\n }\n }\n\n /**\n * Returns the signed in account matching homeAccountId.\n * (the account object is created at the time of successful login)\n * or null when no matching account is found\n * @param homeAccountId\n * @returns The account object stored in MSAL\n */\n getAccountByHomeId(homeAccountId: string): AccountInfo|null {\n const allAccounts = this.getAllAccounts();\n if (!StringUtils.isEmpty(homeAccountId) && allAccounts && allAccounts.length) {\n this.logger.verbose(\"Account matching homeAccountId found, returning\");\n this.logger.verbosePii(`Returning signed-in accounts matching homeAccountId: ${homeAccountId}`);\n return allAccounts.filter(accountObj => accountObj.homeAccountId === homeAccountId)[0] || null;\n } else {\n this.logger.verbose(\"getAccountByHomeId: No matching account found, returning null\");\n return null;\n }\n }\n\n /**\n * Returns the signed in account matching localAccountId.\n * (the account object is created at the time of successful login)\n * or null when no matching account is found\n * @param localAccountId\n * @returns The account object stored in MSAL\n */\n getAccountByLocalId(localAccountId: string): AccountInfo | null {\n const allAccounts = this.getAllAccounts();\n if (!StringUtils.isEmpty(localAccountId) && allAccounts && allAccounts.length) {\n this.logger.verbose(\"Account matching localAccountId found, returning\");\n this.logger.verbosePii(`Returning signed-in accounts matching localAccountId: ${localAccountId}`);\n return allAccounts.filter(accountObj => accountObj.localAccountId === localAccountId)[0] || null;\n } else {\n this.logger.verbose(\"getAccountByLocalId: No matching account found, returning null\");\n return null;\n }\n }\n\n /**\n * Sets the account to use as the active account. If no account is passed to the acquireToken APIs, then MSAL will use this active account.\n * @param account\n */\n setActiveAccount(account: AccountInfo | null): void {\n this.browserStorage.setActiveAccount(account);\n }\n\n /**\n * Gets the currently active account\n */\n getActiveAccount(): AccountInfo | null {\n return this.browserStorage.getActiveAccount();\n }\n\n // #endregion\n\n // #region Helpers\n\n /**\n * Helper to validate app environment before making an auth request\n * * @param interactionType\n */\n protected preflightBrowserEnvironmentCheck(interactionType: InteractionType): void {\n this.logger.verbose(\"preflightBrowserEnvironmentCheck started\");\n // Block request if not in browser environment\n BrowserUtils.blockNonBrowserEnvironment(this.isBrowserEnvironment);\n\n // Block redirects if in an iframe\n BrowserUtils.blockRedirectInIframe(interactionType, this.config.system.allowRedirectInIframe);\n\n // Block auth requests inside a hidden iframe\n BrowserUtils.blockReloadInHiddenIframes();\n\n // Block redirectUri opened in a popup from calling MSAL APIs\n BrowserUtils.blockAcquireTokenInPopups();\n\n // Block redirects if memory storage is enabled but storeAuthStateInCookie is not\n if (interactionType === InteractionType.Redirect &&\n this.config.cache.cacheLocation === BrowserCacheLocation.MemoryStorage &&\n !this.config.cache.storeAuthStateInCookie) {\n throw BrowserConfigurationAuthError.createInMemoryRedirectUnavailableError();\n }\n }\n\n /**\n * Adds event callbacks to array\n * @param callback\n */\n addEventCallback(callback: EventCallbackFunction): string | null {\n return this.eventHandler.addEventCallback(callback);\n }\n\n /**\n * Removes callback with provided id from callback array\n * @param callbackId\n */\n removeEventCallback(callbackId: string): void {\n this.eventHandler.removeEventCallback(callbackId);\n }\n\n /**\n * Adds event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window\n */\n enableAccountStorageEvents(): void {\n this.eventHandler.enableAccountStorageEvents();\n }\n\n /**\n * Removes event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window\n */\n disableAccountStorageEvents(): void {\n this.eventHandler.disableAccountStorageEvents();\n }\n\n /**\n * Gets the token cache for the application.\n */\n getTokenCache(): ITokenCache {\n return this.tokenCache;\n }\n\n /**\n * Returns the logger instance\n */\n getLogger(): Logger {\n return this.logger;\n }\n\n /**\n * Replaces the default logger set in configurations with new Logger with new configurations\n * @param logger Logger instance\n */\n setLogger(logger: Logger): void {\n this.logger = logger;\n }\n\n /**\n * Called by wrapper libraries (Angular & React) to set SKU and Version passed down to telemetry, logger, etc.\n * @param sku\n * @param version\n */\n initializeWrapperLibrary(sku: WrapperSKU, version: string): void {\n // Validate the SKU passed in is one we expect\n this.browserStorage.setWrapperMetadata(sku, version);\n }\n\n /**\n * Sets navigation client\n * @param navigationClient\n */\n setNavigationClient(navigationClient: INavigationClient): void {\n this.navigationClient = navigationClient;\n }\n\n /**\n * Returns the configuration object\n */\n getConfiguration(): BrowserConfiguration {\n return this.config;\n }\n\n // #endregion\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;IAiFI,2BAAY,aAA4B;;;;;;QAMpC,IAAI,CAAC,oBAAoB,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC;;QAE1D,IAAI,CAAC,MAAM,GAAG,kBAAkB,CAAC,aAAa,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC;;QAG3E,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;;QAG1E,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC;;QAGtD,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC;;QAG5D,IAAI,CAAC,gBAAgB,GAAG,IAAI,GAAG,EAAE,CAAC;;QAGlC,IAAI,CAAC,aAAa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sDAA0B,GAA1B;QACI,IAAI,CAAC,YAAY,CAAC,0BAA0B,EAAE,CAAC;KAClD;;;;IAKD,uDAA2B,GAA3B;QACI,IAAI,CAAC,YAAY,CAAC,2BAA2B,EAAE,CAAC;KACnD;;;;IAKD,yCAAa,GAAb;QACI,OAAO,IAAI,CAAC,UAAU,CAAC;KAC1B;;;;IAKD,qCAAS,GAAT;QACI,OAAO,IAAI,CAAC,MAAM,CAAC;KACtB;;;;;IAMD,qCAAS,GAAT,UAAU,MAAc;QACpB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;KACxB;;;;;;IAOD,oDAAwB,GAAxB,UAAyB,GAAe,EAAE,OAAe;;QAErD,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;KACxD;;;;;IAMD,+CAAmB,GAAnB,UAAoB,gBAAmC;QACnD,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;KAC5C;;;;IAKD,4CAAgB,GAAhB;QACI,OAAO,IAAI,CAAC,MAAM,CAAC;KACtB;IAGL,wBAAC;AAAD,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"ClientApplication.js","sources":["../../src/app/ClientApplication.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { CryptoOps } from \"../crypto/CryptoOps\";\nimport { StringUtils, ServerError, InteractionRequiredAuthError, AccountInfo, Constants, INetworkModule, AuthenticationResult, Logger, CommonSilentFlowRequest, ICrypto, DEFAULT_CRYPTO_IMPLEMENTATION } from \"@azure/msal-common\";\nimport { BrowserCacheManager, DEFAULT_BROWSER_CACHE_MANAGER } from \"../cache/BrowserCacheManager\";\nimport { BrowserConfiguration, buildConfiguration, Configuration } from \"../config/Configuration\";\nimport { InteractionType, ApiId, BrowserConstants, BrowserCacheLocation, WrapperSKU, TemporaryCacheKeys } from \"../utils/BrowserConstants\";\nimport { BrowserUtils } from \"../utils/BrowserUtils\";\nimport { RedirectRequest } from \"../request/RedirectRequest\";\nimport { PopupRequest } from \"../request/PopupRequest\";\nimport { SsoSilentRequest } from \"../request/SsoSilentRequest\";\nimport { version, name } from \"../packageMetadata\";\nimport { EventCallbackFunction } from \"../event/EventMessage\";\nimport { EventType } from \"../event/EventType\";\nimport { EndSessionRequest } from \"../request/EndSessionRequest\";\nimport { BrowserConfigurationAuthError } from \"../error/BrowserConfigurationAuthError\";\nimport { EndSessionPopupRequest } from \"../request/EndSessionPopupRequest\";\nimport { INavigationClient } from \"../navigation/INavigationClient\";\nimport { EventHandler } from \"../event/EventHandler\";\nimport { PopupClient } from \"../interaction_client/PopupClient\";\nimport { RedirectClient } from \"../interaction_client/RedirectClient\";\nimport { SilentIframeClient } from \"../interaction_client/SilentIframeClient\";\nimport { SilentRefreshClient } from \"../interaction_client/SilentRefreshClient\";\nimport { TokenCache } from \"../cache/TokenCache\";\nimport { ITokenCache } from \"../cache/ITokenCache\";\nimport { SilentAuthCodeClient } from \"../interaction_client/SilentAuthCodeClient\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { AuthorizationCodeRequest } from \"../request/AuthorizationCodeRequest\";\n\nexport abstract class ClientApplication {\n\n // Crypto interface implementation\n protected readonly browserCrypto: ICrypto;\n\n // Storage interface implementation\n protected readonly browserStorage: BrowserCacheManager;\n\n // Network interface implementation\n protected readonly networkClient: INetworkModule;\n\n // Navigation interface implementation\n protected navigationClient: INavigationClient;\n\n // Input configuration by developer/user\n protected config: BrowserConfiguration;\n\n // Token cache implementation\n private tokenCache: TokenCache;\n\n // Logger\n protected logger: Logger;\n\n // Flag to indicate if in browser environment\n protected isBrowserEnvironment: boolean;\n\n protected eventHandler: EventHandler;\n\n // Redirect Response Object\n private redirectResponse: Map<string, Promise<AuthenticationResult | null>>;\n\n // Hybrid auth code responses\n private hybridAuthCodeResponses: Map<string, Promise<AuthenticationResult>>;\n\n /**\n * @constructor\n * Constructor for the PublicClientApplication used to instantiate the PublicClientApplication object\n *\n * Important attributes in the Configuration object for auth are:\n * - clientID: the application ID of your application. You can obtain one by registering your application with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview\n * - authority: the authority URL for your application.\n * - redirect_uri: the uri of your application registered in the portal.\n *\n * In Azure AD, authority is a URL indicating the Azure active directory that MSAL uses to obtain tokens.\n * It is of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}\n * If your application supports Accounts in one organizational directory, replace \"Enter_the_Tenant_Info_Here\" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).\n * If your application supports Accounts in any organizational directory, replace \"Enter_the_Tenant_Info_Here\" value with organizations.\n * If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace \"Enter_the_Tenant_Info_Here\" value with common.\n * To restrict support to Personal Microsoft accounts only, replace \"Enter_the_Tenant_Info_Here\" value with consumers.\n *\n * In Azure B2C, authority is of the form https://{instance}/tfp/{tenant}/{policyName}/\n * Full B2C functionality will be available in this library in future versions.\n *\n * @param configuration Object for the MSAL PublicClientApplication instance\n */\n constructor(configuration: Configuration) {\n /*\n * If loaded in an environment where window is not available,\n * set internal flag to false so that further requests fail.\n * This is to support server-side rendering environments.\n */\n this.isBrowserEnvironment = typeof window !== \"undefined\";\n // Set the configuration.\n this.config = buildConfiguration(configuration, this.isBrowserEnvironment);\n\n // Initialize logger\n this.logger = new Logger(this.config.system.loggerOptions, name, version);\n \n // Initialize the network module class.\n this.networkClient = this.config.system.networkClient;\n \n // Initialize the navigation client class.\n this.navigationClient = this.config.system.navigationClient;\n \n // Initialize redirectResponse Map\n this.redirectResponse = new Map();\n\n // Initial hybrid spa map\n this.hybridAuthCodeResponses = new Map();\n \n // Initialize the crypto class.\n this.browserCrypto = this.isBrowserEnvironment ? new CryptoOps(this.logger) : DEFAULT_CRYPTO_IMPLEMENTATION;\n\n this.eventHandler = new EventHandler(this.logger, this.browserCrypto);\n\n // Initialize the browser storage class.\n this.browserStorage = this.isBrowserEnvironment ? \n new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger) : \n DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger);\n\n // Initialize the token cache\n this.tokenCache = new TokenCache(this.config, this.browserStorage, this.logger, this.browserCrypto);\n }\n\n // #region Redirect Flow\n\n /**\n * Event handler function which allows users to fire events after the PublicClientApplication object\n * has loaded during redirect flows. This should be invoked on all page loads involved in redirect\n * auth flows.\n * @param hash Hash to process. Defaults to the current value of window.location.hash. Only needs to be provided explicitly if the response to be handled is not contained in the current value.\n * @returns Token response or null. If the return value is null, then no auth redirect was detected.\n */\n async handleRedirectPromise(hash?: string): Promise<AuthenticationResult | null> {\n this.logger.verbose(\"handleRedirectPromise called\");\n const loggedInAccounts = this.getAllAccounts();\n if (this.isBrowserEnvironment) {\n /**\n * Store the promise on the PublicClientApplication instance if this is the first invocation of handleRedirectPromise,\n * otherwise return the promise from the first invocation. Prevents race conditions when handleRedirectPromise is called\n * several times concurrently.\n */\n const redirectResponseKey = hash || Constants.EMPTY_STRING;\n let response = this.redirectResponse.get(redirectResponseKey);\n if (typeof response === \"undefined\") {\n this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_START, InteractionType.Redirect);\n this.logger.verbose(\"handleRedirectPromise has been called for the first time, storing the promise\");\n const correlationId = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.CORRELATION_ID, true) || \"\";\n const redirectClient = new RedirectClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, correlationId);\n response = redirectClient.handleRedirectPromise(hash)\n .then((result: AuthenticationResult | null) => {\n if (result) {\n // Emit login event if number of accounts change\n const isLoggingIn = loggedInAccounts.length < this.getAllAccounts().length;\n if (isLoggingIn) {\n this.eventHandler.emitEvent(EventType.LOGIN_SUCCESS, InteractionType.Redirect, result);\n this.logger.verbose(\"handleRedirectResponse returned result, login success\");\n } else {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Redirect, result);\n this.logger.verbose(\"handleRedirectResponse returned result, acquire token success\");\n }\n }\n this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_END, InteractionType.Redirect);\n\n return result;\n })\n .catch((e) => {\n // Emit login event if there is an account\n if (loggedInAccounts.length > 0) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Redirect, null, e);\n } else {\n this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, InteractionType.Redirect, null, e);\n }\n this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_END, InteractionType.Redirect);\n\n throw e;\n });\n this.redirectResponse.set(redirectResponseKey, response);\n } else {\n this.logger.verbose(\"handleRedirectPromise has been called previously, returning the result from the first call\");\n }\n \n return response;\n }\n this.logger.verbose(\"handleRedirectPromise returns null, not browser environment\");\n return null;\n }\n\n /**\n * Use when you want to obtain an access_token for your API by redirecting the user's browser window to the authorization endpoint. This function redirects\n * the page, so any code that follows this function will not execute.\n *\n * IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current\n * browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.\n *\n * @param request\n */\n async acquireTokenRedirect(request: RedirectRequest): Promise<void> {\n // Preflight request\n this.preflightBrowserEnvironmentCheck(InteractionType.Redirect);\n this.logger.verbose(\"acquireTokenRedirect called\");\n\n // If logged in, emit acquire token events\n const isLoggedIn = this.getAllAccounts().length > 0;\n if (isLoggedIn) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Redirect, request);\n } else {\n this.eventHandler.emitEvent(EventType.LOGIN_START, InteractionType.Redirect, request);\n }\n \n const redirectClient = new RedirectClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, request.correlationId);\n return redirectClient.acquireToken(request).catch((e) => {\n // If logged in, emit acquire token events\n if (isLoggedIn) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Redirect, null, e);\n } else {\n this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, InteractionType.Redirect, null, e);\n }\n throw e;\n });\n }\n\n // #endregion\n\n // #region Popup Flow\n\n /**\n * Use when you want to obtain an access_token for your API via opening a popup window in the user's browser\n *\n * @param request\n *\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n acquireTokenPopup(request: PopupRequest): Promise<AuthenticationResult> {\n try {\n this.preflightBrowserEnvironmentCheck(InteractionType.Popup);\n this.logger.verbose(\"acquireTokenPopup called\", request.correlationId);\n } catch (e) {\n // Since this function is syncronous we need to reject\n return Promise.reject(e);\n }\n\n // If logged in, emit acquire token events\n const loggedInAccounts = this.getAllAccounts();\n if (loggedInAccounts.length > 0) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Popup, request);\n } else {\n this.eventHandler.emitEvent(EventType.LOGIN_START, InteractionType.Popup, request);\n }\n\n const popupClient = new PopupClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, request.correlationId);\n\n return popupClient.acquireToken(request).then((result) => {\n // If logged in, emit acquire token events\n const isLoggingIn = loggedInAccounts.length < this.getAllAccounts().length;\n if (isLoggingIn) {\n this.eventHandler.emitEvent(EventType.LOGIN_SUCCESS, InteractionType.Popup, result);\n } else {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Popup, result);\n }\n\n return result;\n }).catch((e) => {\n if (loggedInAccounts.length > 0) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Popup, null, e);\n } else {\n this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, InteractionType.Popup, null, e);\n }\n // Since this function is syncronous we need to reject\n return Promise.reject(e);\n });\n }\n\n // #endregion\n\n // #region Silent Flow\n\n /**\n * This function uses a hidden iframe to fetch an authorization code from the eSTS. There are cases where this may not work:\n * - Any browser using a form of Intelligent Tracking Prevention\n * - If there is not an established session with the service\n *\n * In these cases, the request must be done inside a popup or full frame redirect.\n *\n * For the cases where interaction is required, you cannot send a request with prompt=none.\n *\n * If your refresh token has expired, you can use this function to fetch a new set of tokens silently as long as\n * you session on the server still exists.\n * @param request {@link SsoSilentRequest}\n *\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n async ssoSilent(request: SsoSilentRequest): Promise<AuthenticationResult> {\n this.preflightBrowserEnvironmentCheck(InteractionType.Silent);\n this.logger.verbose(\"ssoSilent called\", request.correlationId);\n this.eventHandler.emitEvent(EventType.SSO_SILENT_START, InteractionType.Silent, request);\n\n try {\n const silentIframeClient = new SilentIframeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.ssoSilent, request.correlationId);\n const silentTokenResult = await silentIframeClient.acquireToken(request);\n this.eventHandler.emitEvent(EventType.SSO_SILENT_SUCCESS, InteractionType.Silent, silentTokenResult);\n return silentTokenResult;\n } catch (e) {\n this.eventHandler.emitEvent(EventType.SSO_SILENT_FAILURE, InteractionType.Silent, null, e);\n throw e;\n }\n }\n\n /**\n * This function redeems an authorization code (passed as code) from the eSTS token endpoint.\n * This authorization code should be acquired server-side using a confidential client to acquire a spa_code.\n * This API is not indended for normal authorization code acquisition and redemption.\n * \n * Redemption of this authorization code will not require PKCE, as it was acquired by a confidential client.\n * \n * @param request {@link AuthorizationCodeRequest}\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n async acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult> {\n this.preflightBrowserEnvironmentCheck(InteractionType.Silent);\n this.logger.trace(\"acquireTokenByCode called\", request.correlationId);\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_START, InteractionType.Silent, request);\n\n try {\n if (!request.code) {\n throw BrowserAuthError.createAuthCodeRequiredError();\n }\n\n let response = this.hybridAuthCodeResponses.get(request.code);\n if (!response) {\n this.logger.verbose(\"Initiating new acquireTokenByCode request\", request.correlationId);\n response = this.acquireTokenByCodeAsync(request)\n .then((result: AuthenticationResult) => {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_SUCCESS, InteractionType.Silent, result);\n this.hybridAuthCodeResponses.delete(request.code);\n return result;\n })\n .catch((error: Error) => {\n this.hybridAuthCodeResponses.delete(request.code);\n throw error;\n });\n\n this.hybridAuthCodeResponses.set(request.code, response);\n } else {\n this.logger.verbose(\"Existing acquireTokenByCode request found\", request.correlationId);\n }\n \n return response;\n } catch (e) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE, InteractionType.Silent, null, e);\n throw e;\n }\n }\n\n /**\n * Creates a SilentAuthCodeClient to redeem an authorization code.\n * @param request \n * @returns Result of the operation to redeem the authorization code\n */\n private async acquireTokenByCodeAsync(request: AuthorizationCodeRequest): Promise<AuthenticationResult> {\n this.logger.trace(\"acquireTokenByCodeAsync called\", request.correlationId);\n const silentAuthCodeClient = new SilentAuthCodeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenByCode, request.correlationId);\n const silentTokenResult = await silentAuthCodeClient.acquireToken(request);\n return silentTokenResult;\n }\n\n /**\n * Use this function to obtain a token before every call to the API / resource provider\n *\n * MSAL return's a cached token when available\n * Or it send's a request to the STS to obtain a new token using a refresh token.\n *\n * @param {@link SilentRequest}\n *\n * To renew idToken, please pass clientId as the only scope in the Authentication Parameters\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n protected async acquireTokenByRefreshToken(request: CommonSilentFlowRequest): Promise<AuthenticationResult> {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_NETWORK_START, InteractionType.Silent, request);\n // block the reload if it occurred inside a hidden iframe\n BrowserUtils.blockReloadInHiddenIframes();\n\n const silentRefreshClient = new SilentRefreshClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, request.correlationId);\n\n return silentRefreshClient.acquireToken(request).catch(e => {\n const isServerError = e instanceof ServerError;\n const isInteractionRequiredError = e instanceof InteractionRequiredAuthError;\n const isInvalidGrantError = (e.errorCode === BrowserConstants.INVALID_GRANT_ERROR);\n if (isServerError && isInvalidGrantError && !isInteractionRequiredError) {\n this.logger.verbose(\"Refresh token expired or invalid, attempting acquire token by iframe\", request.correlationId);\n\n const silentIframeClient = new SilentIframeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenSilent_authCode, request.correlationId);\n return silentIframeClient.acquireToken(request);\n }\n throw e;\n });\n }\n\n // #endregion\n\n // #region Logout\n\n /**\n * Deprecated logout function. Use logoutRedirect or logoutPopup instead\n * @param logoutRequest \n * @deprecated\n */\n async logout(logoutRequest?: EndSessionRequest): Promise<void> {\n this.logger.warning(\"logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.\");\n return this.logoutRedirect(logoutRequest);\n }\n\n /**\n * Use to log out the current user, and redirect the user to the postLogoutRedirectUri.\n * Default behaviour is to redirect the user to `window.location.href`.\n * @param logoutRequest\n */\n async logoutRedirect(logoutRequest?: EndSessionRequest): Promise<void> {\n this.preflightBrowserEnvironmentCheck(InteractionType.Redirect);\n const redirectClient = new RedirectClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, logoutRequest?.correlationId);\n return redirectClient.logout(logoutRequest);\n }\n\n /**\n * Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server\n * @param logoutRequest \n */\n logoutPopup(logoutRequest?: EndSessionPopupRequest): Promise<void> {\n try{\n this.preflightBrowserEnvironmentCheck(InteractionType.Popup);\n const popupClient = new PopupClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, logoutRequest?.correlationId);\n return popupClient.logout(logoutRequest);\n } catch (e) {\n // Since this function is syncronous we need to reject\n return Promise.reject(e);\n }\n }\n\n // #endregion\n\n // #region Account APIs\n\n /**\n * Returns all accounts that MSAL currently has data for.\n * (the account object is created at the time of successful login)\n * or empty array when no accounts are found\n * @returns Array of account objects in cache\n */\n getAllAccounts(): AccountInfo[] {\n this.logger.verbose(\"getAllAccounts called\");\n return this.isBrowserEnvironment ? this.browserStorage.getAllAccounts() : [];\n }\n\n /**\n * Returns the signed in account matching username.\n * (the account object is created at the time of successful login)\n * or null when no matching account is found.\n * This API is provided for convenience but getAccountById should be used for best reliability\n * @param userName\n * @returns The account object stored in MSAL\n */\n getAccountByUsername(userName: string): AccountInfo|null {\n const allAccounts = this.getAllAccounts();\n if (!StringUtils.isEmpty(userName) && allAccounts && allAccounts.length) {\n this.logger.verbose(\"Account matching username found, returning\");\n this.logger.verbosePii(`Returning signed-in accounts matching username: ${userName}`);\n return allAccounts.filter(accountObj => accountObj.username.toLowerCase() === userName.toLowerCase())[0] || null;\n } else {\n this.logger.verbose(\"getAccountByUsername: No matching account found, returning null\");\n return null;\n }\n }\n\n /**\n * Returns the signed in account matching homeAccountId.\n * (the account object is created at the time of successful login)\n * or null when no matching account is found\n * @param homeAccountId\n * @returns The account object stored in MSAL\n */\n getAccountByHomeId(homeAccountId: string): AccountInfo|null {\n const allAccounts = this.getAllAccounts();\n if (!StringUtils.isEmpty(homeAccountId) && allAccounts && allAccounts.length) {\n this.logger.verbose(\"Account matching homeAccountId found, returning\");\n this.logger.verbosePii(`Returning signed-in accounts matching homeAccountId: ${homeAccountId}`);\n return allAccounts.filter(accountObj => accountObj.homeAccountId === homeAccountId)[0] || null;\n } else {\n this.logger.verbose(\"getAccountByHomeId: No matching account found, returning null\");\n return null;\n }\n }\n\n /**\n * Returns the signed in account matching localAccountId.\n * (the account object is created at the time of successful login)\n * or null when no matching account is found\n * @param localAccountId\n * @returns The account object stored in MSAL\n */\n getAccountByLocalId(localAccountId: string): AccountInfo | null {\n const allAccounts = this.getAllAccounts();\n if (!StringUtils.isEmpty(localAccountId) && allAccounts && allAccounts.length) {\n this.logger.verbose(\"Account matching localAccountId found, returning\");\n this.logger.verbosePii(`Returning signed-in accounts matching localAccountId: ${localAccountId}`);\n return allAccounts.filter(accountObj => accountObj.localAccountId === localAccountId)[0] || null;\n } else {\n this.logger.verbose(\"getAccountByLocalId: No matching account found, returning null\");\n return null;\n }\n }\n\n /**\n * Sets the account to use as the active account. If no account is passed to the acquireToken APIs, then MSAL will use this active account.\n * @param account\n */\n setActiveAccount(account: AccountInfo | null): void {\n this.browserStorage.setActiveAccount(account);\n }\n\n /**\n * Gets the currently active account\n */\n getActiveAccount(): AccountInfo | null {\n return this.browserStorage.getActiveAccount();\n }\n\n // #endregion\n\n // #region Helpers\n\n /**\n * Helper to validate app environment before making an auth request\n * * @param interactionType\n */\n protected preflightBrowserEnvironmentCheck(interactionType: InteractionType): void {\n this.logger.verbose(\"preflightBrowserEnvironmentCheck started\");\n // Block request if not in browser environment\n BrowserUtils.blockNonBrowserEnvironment(this.isBrowserEnvironment);\n\n // Block redirects if in an iframe\n BrowserUtils.blockRedirectInIframe(interactionType, this.config.system.allowRedirectInIframe);\n\n // Block auth requests inside a hidden iframe\n BrowserUtils.blockReloadInHiddenIframes();\n\n // Block redirectUri opened in a popup from calling MSAL APIs\n BrowserUtils.blockAcquireTokenInPopups();\n\n // Block redirects if memory storage is enabled but storeAuthStateInCookie is not\n if (interactionType === InteractionType.Redirect &&\n this.config.cache.cacheLocation === BrowserCacheLocation.MemoryStorage &&\n !this.config.cache.storeAuthStateInCookie) {\n throw BrowserConfigurationAuthError.createInMemoryRedirectUnavailableError();\n }\n }\n\n /**\n * Adds event callbacks to array\n * @param callback\n */\n addEventCallback(callback: EventCallbackFunction): string | null {\n return this.eventHandler.addEventCallback(callback);\n }\n\n /**\n * Removes callback with provided id from callback array\n * @param callbackId\n */\n removeEventCallback(callbackId: string): void {\n this.eventHandler.removeEventCallback(callbackId);\n }\n\n /**\n * Adds event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window\n */\n enableAccountStorageEvents(): void {\n this.eventHandler.enableAccountStorageEvents();\n }\n\n /**\n * Removes event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window\n */\n disableAccountStorageEvents(): void {\n this.eventHandler.disableAccountStorageEvents();\n }\n\n /**\n * Gets the token cache for the application.\n */\n getTokenCache(): ITokenCache {\n return this.tokenCache;\n }\n\n /**\n * Returns the logger instance\n */\n getLogger(): Logger {\n return this.logger;\n }\n\n /**\n * Replaces the default logger set in configurations with new Logger with new configurations\n * @param logger Logger instance\n */\n setLogger(logger: Logger): void {\n this.logger = logger;\n }\n\n /**\n * Called by wrapper libraries (Angular & React) to set SKU and Version passed down to telemetry, logger, etc.\n * @param sku\n * @param version\n */\n initializeWrapperLibrary(sku: WrapperSKU, version: string): void {\n // Validate the SKU passed in is one we expect\n this.browserStorage.setWrapperMetadata(sku, version);\n }\n\n /**\n * Sets navigation client\n * @param navigationClient\n */\n setNavigationClient(navigationClient: INavigationClient): void {\n this.navigationClient = navigationClient;\n }\n\n /**\n * Returns the configuration object\n */\n getConfiguration(): BrowserConfiguration {\n return this.config;\n }\n\n // #endregion\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;IAuFI,2BAAY,aAA4B;;;;;;QAMpC,IAAI,CAAC,oBAAoB,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC;;QAE1D,IAAI,CAAC,MAAM,GAAG,kBAAkB,CAAC,aAAa,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC;;QAG3E,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;;QAG1E,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC;;QAGtD,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC;;QAG5D,IAAI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AAS,GAAT,UAAU,MAAc;QACpB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;KACxB;;;;;;IAOD,oDAAwB,GAAxB,UAAyB,GAAe,EAAE,OAAe;;QAErD,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;KACxD;;;;;IAMD,+CAAmB,GAAnB,UAAoB,gBAAmC;QACnD,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;KAC5C;;;;IAKD,4CAAgB,GAAhB;QACI,OAAO,IAAI,CAAC,MAAM,CAAC;KACtB;IAGL,wBAAC;AAAD,CAAC;;;;"}
|
|
@@ -8,11 +8,13 @@ import { WrapperSKU } from "../utils/BrowserConstants";
|
|
|
8
8
|
import { INavigationClient } from "../navigation/INavigationClient";
|
|
9
9
|
import { EndSessionPopupRequest } from "../request/EndSessionPopupRequest";
|
|
10
10
|
import { ITokenCache } from "../cache/ITokenCache";
|
|
11
|
+
import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest";
|
|
11
12
|
import { BrowserConfiguration } from "../config/Configuration";
|
|
12
13
|
export interface IPublicClientApplication {
|
|
13
14
|
acquireTokenPopup(request: PopupRequest): Promise<AuthenticationResult>;
|
|
14
15
|
acquireTokenRedirect(request: RedirectRequest): Promise<void>;
|
|
15
16
|
acquireTokenSilent(silentRequest: SilentRequest): Promise<AuthenticationResult>;
|
|
17
|
+
acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult>;
|
|
16
18
|
addEventCallback(callback: Function): string | null;
|
|
17
19
|
removeEventCallback(callbackId: string): void;
|
|
18
20
|
enableAccountStorageEvents(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IPublicClientApplication.d.ts","sourceRoot":"","sources":["../../src/app/IPublicClientApplication.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO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BrowserConfigurationAuthError } from '../error/BrowserConfigurationAuthError.js';
|
|
4
4
|
|
|
@@ -16,6 +16,9 @@ var stubbedPublicClientApplication = {
|
|
|
16
16
|
acquireTokenSilent: function () {
|
|
17
17
|
return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());
|
|
18
18
|
},
|
|
19
|
+
acquireTokenByCode: function () {
|
|
20
|
+
return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());
|
|
21
|
+
},
|
|
19
22
|
getAllAccounts: function () {
|
|
20
23
|
return [];
|
|
21
24
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IPublicClientApplication.js","sources":["../../src/app/IPublicClientApplication.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthenticationResult, AccountInfo, Logger } from \"@azure/msal-common\";\nimport { RedirectRequest } from \"../request/RedirectRequest\";\nimport { PopupRequest } from \"../request/PopupRequest\";\nimport { SilentRequest } from \"../request/SilentRequest\";\nimport { SsoSilentRequest } from \"../request/SsoSilentRequest\";\nimport { EndSessionRequest } from \"../request/EndSessionRequest\";\nimport { BrowserConfigurationAuthError } from \"../error/BrowserConfigurationAuthError\";\nimport { WrapperSKU } from \"../utils/BrowserConstants\";\nimport { INavigationClient } from \"../navigation/INavigationClient\";\nimport { EndSessionPopupRequest } from \"../request/EndSessionPopupRequest\";\nimport { ITokenCache } from \"../cache/ITokenCache\";\nimport { BrowserConfiguration } from \"../config/Configuration\";\n\nexport interface IPublicClientApplication {\n acquireTokenPopup(request: PopupRequest): Promise<AuthenticationResult>;\n acquireTokenRedirect(request: RedirectRequest): Promise<void>;\n acquireTokenSilent(silentRequest: SilentRequest): Promise<AuthenticationResult>;\n addEventCallback(callback: Function): string | null;\n removeEventCallback(callbackId: string): void;\n enableAccountStorageEvents(): void;\n disableAccountStorageEvents(): void;\n getAccountByHomeId(homeAccountId: string): AccountInfo | null;\n getAccountByLocalId(localId: string): AccountInfo | null;\n getAccountByUsername(userName: string): AccountInfo | null;\n getAllAccounts(): AccountInfo[];\n handleRedirectPromise(hash?: string): Promise<AuthenticationResult | null>;\n loginPopup(request?: PopupRequest): Promise<AuthenticationResult>;\n loginRedirect(request?: RedirectRequest): Promise<void>;\n logout(logoutRequest?: EndSessionRequest): Promise<void>;\n logoutRedirect(logoutRequest?: EndSessionRequest): Promise<void>;\n logoutPopup(logoutRequest?: EndSessionPopupRequest): Promise<void>;\n ssoSilent(request: SsoSilentRequest): Promise<AuthenticationResult>;\n getTokenCache(): ITokenCache;\n getLogger(): Logger;\n setLogger(logger: Logger): void;\n setActiveAccount(account: AccountInfo | null): void;\n getActiveAccount(): AccountInfo | null;\n initializeWrapperLibrary(sku: WrapperSKU, version: string): void;\n setNavigationClient(navigationClient: INavigationClient): void;\n getConfiguration(): BrowserConfiguration;\n}\n\nexport const stubbedPublicClientApplication: IPublicClientApplication = {\n acquireTokenPopup: () => {\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\n },\n acquireTokenRedirect: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\t\n acquireTokenSilent: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\
|
|
1
|
+
{"version":3,"file":"IPublicClientApplication.js","sources":["../../src/app/IPublicClientApplication.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthenticationResult, AccountInfo, Logger } from \"@azure/msal-common\";\nimport { RedirectRequest } from \"../request/RedirectRequest\";\nimport { PopupRequest } from \"../request/PopupRequest\";\nimport { SilentRequest } from \"../request/SilentRequest\";\nimport { SsoSilentRequest } from \"../request/SsoSilentRequest\";\nimport { EndSessionRequest } from \"../request/EndSessionRequest\";\nimport { BrowserConfigurationAuthError } from \"../error/BrowserConfigurationAuthError\";\nimport { WrapperSKU } from \"../utils/BrowserConstants\";\nimport { INavigationClient } from \"../navigation/INavigationClient\";\nimport { EndSessionPopupRequest } from \"../request/EndSessionPopupRequest\";\nimport { ITokenCache } from \"../cache/ITokenCache\";\nimport { AuthorizationCodeRequest } from \"../request/AuthorizationCodeRequest\";\nimport { BrowserConfiguration } from \"../config/Configuration\";\n\nexport interface IPublicClientApplication {\n acquireTokenPopup(request: PopupRequest): Promise<AuthenticationResult>;\n acquireTokenRedirect(request: RedirectRequest): Promise<void>;\n acquireTokenSilent(silentRequest: SilentRequest): Promise<AuthenticationResult>;\n acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult>;\n addEventCallback(callback: Function): string | null;\n removeEventCallback(callbackId: string): void;\n enableAccountStorageEvents(): void;\n disableAccountStorageEvents(): void;\n getAccountByHomeId(homeAccountId: string): AccountInfo | null;\n getAccountByLocalId(localId: string): AccountInfo | null;\n getAccountByUsername(userName: string): AccountInfo | null;\n getAllAccounts(): AccountInfo[];\n handleRedirectPromise(hash?: string): Promise<AuthenticationResult | null>;\n loginPopup(request?: PopupRequest): Promise<AuthenticationResult>;\n loginRedirect(request?: RedirectRequest): Promise<void>;\n logout(logoutRequest?: EndSessionRequest): Promise<void>;\n logoutRedirect(logoutRequest?: EndSessionRequest): Promise<void>;\n logoutPopup(logoutRequest?: EndSessionPopupRequest): Promise<void>;\n ssoSilent(request: SsoSilentRequest): Promise<AuthenticationResult>;\n getTokenCache(): ITokenCache;\n getLogger(): Logger;\n setLogger(logger: Logger): void;\n setActiveAccount(account: AccountInfo | null): void;\n getActiveAccount(): AccountInfo | null;\n initializeWrapperLibrary(sku: WrapperSKU, version: string): void;\n setNavigationClient(navigationClient: INavigationClient): void;\n getConfiguration(): BrowserConfiguration;\n}\n\nexport const stubbedPublicClientApplication: IPublicClientApplication = {\n acquireTokenPopup: () => {\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\n },\n acquireTokenRedirect: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\t\n acquireTokenSilent: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\n acquireTokenByCode: () => {\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\n },\n getAllAccounts: () => {\n return [];\t\n },\t\n getAccountByHomeId: () => {\n return null;\n },\n getAccountByUsername: () => {\t\n return null;\t\n },\t\n getAccountByLocalId: () => {\n return null;\n },\n handleRedirectPromise: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\t\n loginPopup: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\t\n loginRedirect: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\t\n logout: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\t\n logoutRedirect: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\n logoutPopup: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\n ssoSilent: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\n addEventCallback: () => {\n return null;\n },\n removeEventCallback: () => {\n return;\n },\n enableAccountStorageEvents: () => {\n return;\n },\n disableAccountStorageEvents: () => {\n return;\n },\n getTokenCache: () => {\n throw BrowserConfigurationAuthError.createStubPcaInstanceCalledError();\n },\n getLogger: () => {\n throw BrowserConfigurationAuthError.createStubPcaInstanceCalledError();\n },\n setLogger: () => {\n return;\n },\n setActiveAccount: () => {\n return;\n },\n getActiveAccount: () => {\n return null;\n },\n initializeWrapperLibrary: () => {\n return;\n },\n setNavigationClient: () => {\n return;\n },\n getConfiguration: () => {\n throw BrowserConfigurationAuthError.createStubPcaInstanceCalledError();\n }\n};\n"],"names":[],"mappings":";;;;AAAA;;;;IAiDa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AAS,EAAE;QACP,OAAO,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,gCAAgC,EAAE,CAAC,CAAC;KAC3F;IACD,gBAAgB,EAAE;QACd,OAAO,IAAI,CAAC;KACf;IACD,mBAAmB,EAAE;QACjB,OAAO;KACV;IACD,0BAA0B,EAAE;QACxB,OAAO;KACV;IACD,2BAA2B,EAAE;QACzB,OAAO;KACV;IACD,aAAa,EAAE;QACX,MAAM,6BAA6B,CAAC,gCAAgC,EAAE,CAAC;KAC1E;IACD,SAAS,EAAE;QACP,MAAM,6BAA6B,CAAC,gCAAgC,EAAE,CAAC;KAC1E;IACD,SAAS,EAAE;QACP,OAAO;KACV;IACD,gBAAgB,EAAE;QACd,OAAO;KACV;IACD,gBAAgB,EAAE;QACd,OAAO,IAAI,CAAC;KACf;IACD,wBAAwB,EAAE;QACtB,OAAO;KACV;IACD,mBAAmB,EAAE;QACjB,OAAO;KACV;IACD,gBAAgB,EAAE;QACd,MAAM,6BAA6B,CAAC,gCAAgC,EAAE,CAAC;KAC1E;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsyncMemoryStorage.d.ts","sourceRoot":"","sources":["../../src/cache/AsyncMemoryStorage.ts"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"AsyncMemoryStorage.d.ts","sourceRoot":"","sources":["../../src/cache/AsyncMemoryStorage.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGtD;;;GAGG;AACH,qBAAa,kBAAkB,CAAC,CAAC,CAAE,YAAW,aAAa,CAAC,CAAC,CAAC;IAC1D,OAAO,CAAC,aAAa,CAAmB;IACxC,OAAO,CAAC,cAAc,CAAqB;IAC3C,OAAO,CAAC,MAAM,CAAS;gBAEX,MAAM,EAAE,MAAM;IAM1B,OAAO,CAAC,yBAAyB;IAKjC;;;;OAIG;IACG,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAa7C;;;;;OAKG;IACG,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IASnD;;;OAGG;IACG,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAS5C;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAalC;;;OAGG;IACG,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAahD;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAQ/B"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.20.0 2021-12-07 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __awaiter, __generator } from '../_virtual/_tslib.js';
|
|
4
|
+
import { BrowserAuthError, BrowserAuthErrorMessage } from '../error/BrowserAuthError.js';
|
|
4
5
|
import { DatabaseStorage } from './DatabaseStorage.js';
|
|
5
6
|
import { MemoryStorage } from './MemoryStorage.js';
|
|
6
|
-
import { BrowserAuthError, BrowserAuthErrorMessage } from '../error/BrowserAuthError.js';
|
|
7
7
|
|
|
8
8
|
/*
|
|
9
9
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|