@azure/msal-browser 2.26.0 → 2.28.1
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 -1
- package/dist/_virtual/_tslib.js +14 -2
- package/dist/_virtual/_tslib.js.map +1 -1
- package/dist/app/ClientApplication.d.ts +2 -1
- package/dist/app/ClientApplication.d.ts.map +1 -1
- package/dist/app/ClientApplication.js +49 -15
- package/dist/app/ClientApplication.js.map +1 -1
- package/dist/app/IPublicClientApplication.js +1 -1
- package/dist/app/PublicClientApplication.d.ts.map +1 -1
- package/dist/app/PublicClientApplication.js +5 -3
- package/dist/app/PublicClientApplication.js.map +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.js +1 -1
- package/dist/broker/nativeBroker/NativeRequest.d.ts +1 -1
- package/dist/broker/nativeBroker/NativeRequest.d.ts.map +1 -1
- package/dist/broker/nativeBroker/NativeResponse.d.ts +1 -1
- package/dist/broker/nativeBroker/NativeResponse.d.ts.map +1 -1
- package/dist/cache/AsyncMemoryStorage.js +1 -1
- package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
- package/dist/cache/BrowserCacheManager.js +40 -9
- package/dist/cache/BrowserCacheManager.js.map +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.d.ts.map +1 -1
- package/dist/cache/TokenCache.js +2 -1
- package/dist/cache/TokenCache.js.map +1 -1
- package/dist/config/Configuration.d.ts +4 -0
- package/dist/config/Configuration.d.ts.map +1 -1
- package/dist/config/Configuration.js +2 -1
- package/dist/config/Configuration.js.map +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.js +1 -1
- package/dist/error/BrowserConfigurationAuthError.js +1 -1
- package/dist/error/NativeAuthError.d.ts +11 -1
- package/dist/error/NativeAuthError.d.ts.map +1 -1
- package/dist/error/NativeAuthError.js +15 -1
- package/dist/error/NativeAuthError.js.map +1 -1
- package/dist/event/EventHandler.js +1 -1
- package/dist/event/EventMessage.js +1 -1
- package/dist/event/EventType.js +1 -1
- package/dist/index.cjs.js +811 -411
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/interaction_client/BaseInteractionClient.js +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +1 -1
- package/dist/interaction_client/NativeInteractionClient.d.ts +18 -1
- package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/NativeInteractionClient.js +123 -33
- package/dist/interaction_client/NativeInteractionClient.js.map +1 -1
- package/dist/interaction_client/PopupClient.d.ts +2 -1
- package/dist/interaction_client/PopupClient.d.ts.map +1 -1
- package/dist/interaction_client/PopupClient.js +4 -3
- package/dist/interaction_client/PopupClient.js.map +1 -1
- package/dist/interaction_client/RedirectClient.d.ts +8 -1
- package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
- package/dist/interaction_client/RedirectClient.js +6 -4
- package/dist/interaction_client/RedirectClient.js.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.js +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.js.map +1 -1
- package/dist/interaction_client/SilentCacheClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentCacheClient.js +2 -2
- package/dist/interaction_client/SilentCacheClient.js.map +1 -1
- package/dist/interaction_client/SilentIframeClient.d.ts +2 -1
- package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentIframeClient.js +4 -3
- package/dist/interaction_client/SilentIframeClient.js.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.js +2 -2
- package/dist/interaction_client/SilentRefreshClient.js.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.js +2 -1
- package/dist/interaction_client/StandardInteractionClient.js.map +1 -1
- package/dist/interaction_handler/InteractionHandler.js +1 -1
- package/dist/interaction_handler/RedirectHandler.js +1 -1
- package/dist/interaction_handler/SilentHandler.js +1 -1
- package/dist/internals.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/PopupRequest.d.ts +1 -1
- package/dist/request/RedirectRequest.d.ts +1 -1
- package/dist/request/SsoSilentRequest.d.ts +1 -1
- package/dist/telemetry/BrowserPerformanceClient.js +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.js +1 -1
- package/dist/utils/BrowserConstants.js +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/lib/msal-browser.js +811 -411
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +43 -41
- package/package.json +3 -4
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.28.1/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.
|
package/dist/_virtual/_tslib.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.28.1 2022-08-01 */
|
|
2
2
|
'use strict';
|
|
3
3
|
/*! *****************************************************************************
|
|
4
4
|
Copyright (c) Microsoft Corporation.
|
|
@@ -40,6 +40,18 @@ var __assign = function() {
|
|
|
40
40
|
return __assign.apply(this, arguments);
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
+
function __rest(s, e) {
|
|
44
|
+
var t = {};
|
|
45
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
46
|
+
t[p] = s[p];
|
|
47
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
48
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
49
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
50
|
+
t[p[i]] = s[p[i]];
|
|
51
|
+
}
|
|
52
|
+
return t;
|
|
53
|
+
}
|
|
54
|
+
|
|
43
55
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
44
56
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
45
57
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -101,5 +113,5 @@ function __spread() {
|
|
|
101
113
|
return ar;
|
|
102
114
|
}
|
|
103
115
|
|
|
104
|
-
export { __assign, __awaiter, __extends, __generator, __read, __spread };
|
|
116
|
+
export { __assign, __awaiter, __extends, __generator, __read, __rest, __spread };
|
|
105
117
|
//# sourceMappingURL=_tslib.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_tslib.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_tslib.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -23,6 +23,7 @@ import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest";
|
|
|
23
23
|
export declare abstract class ClientApplication {
|
|
24
24
|
protected readonly browserCrypto: ICrypto;
|
|
25
25
|
protected readonly browserStorage: BrowserCacheManager;
|
|
26
|
+
protected readonly nativeInternalStorage: BrowserCacheManager;
|
|
26
27
|
protected readonly networkClient: INetworkModule;
|
|
27
28
|
protected navigationClient: INavigationClient;
|
|
28
29
|
protected config: BrowserConfiguration;
|
|
@@ -227,7 +228,7 @@ export declare abstract class ClientApplication {
|
|
|
227
228
|
*/
|
|
228
229
|
protected createPopupClient(correlationId?: string): PopupClient;
|
|
229
230
|
/**
|
|
230
|
-
* Returns new instance of the
|
|
231
|
+
* Returns new instance of the Redirect Interaction Client
|
|
231
232
|
* @param correlationId
|
|
232
233
|
*/
|
|
233
234
|
protected createRedirectClient(correlationId?: string): RedirectClient;
|
|
@@ -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,EAA+D,2BAA2B,EAAyB,kBAAkB,EAAE,eAAe,EAAe,MAAM,oBAAoB,CAAC;AACvW,OAAO,EAAE,mBAAmB,EAAiC,MAAM,8BAA8B,CAAC;AAClG,OAAO,EAAE,oBAAoB,
|
|
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,EAA+D,2BAA2B,EAAy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AEG;IACH,SAAS,IAAI,MAAM;IAInB;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAI/B;;;;OAIG;IACH,wBAAwB,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAKhE;;;OAGG;IACH,mBAAmB,CAAC,gBAAgB,EAAE,iBAAiB,GAAG,IAAI;IAI9D;;OAEG;IACH,gBAAgB,IAAI,oBAAoB;IAIxC;;;;;;OAMG;IACH,SAAS,CAAC,uBAAuB,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,MAAM;CAiBhF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.28.1 2022-08-01 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
|
|
4
4
|
import { CryptoOps } from '../crypto/CryptoOps.js';
|
|
5
|
-
import { Constants, PerformanceEvents, PromptValue, AuthError, StringUtils, Logger, StubPerformanceClient, DEFAULT_CRYPTO_IMPLEMENTATION, ServerError
|
|
5
|
+
import { Constants, InteractionRequiredAuthError, PerformanceEvents, PromptValue, AuthError, StringUtils, Logger, StubPerformanceClient, DEFAULT_CRYPTO_IMPLEMENTATION, ServerError } from '@azure/msal-common';
|
|
6
6
|
import { BrowserCacheManager, DEFAULT_BROWSER_CACHE_MANAGER } from '../cache/BrowserCacheManager.js';
|
|
7
7
|
import { buildConfiguration } from '../config/Configuration.js';
|
|
8
8
|
import { InteractionType, ApiId, TemporaryCacheKeys, BrowserCacheLocation, BrowserConstants } from '../utils/BrowserConstants.js';
|
|
@@ -81,6 +81,13 @@ var ClientApplication = /** @class */ (function () {
|
|
|
81
81
|
this.browserStorage = this.isBrowserEnvironment ?
|
|
82
82
|
new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger) :
|
|
83
83
|
DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger);
|
|
84
|
+
// initialize in memory storage for native flows
|
|
85
|
+
var nativeCacheOptions = {
|
|
86
|
+
cacheLocation: BrowserCacheLocation.MemoryStorage,
|
|
87
|
+
storeAuthStateInCookie: false,
|
|
88
|
+
secureCookies: false
|
|
89
|
+
};
|
|
90
|
+
this.nativeInternalStorage = new BrowserCacheManager(this.config.auth.clientId, nativeCacheOptions, this.browserCrypto, this.logger);
|
|
84
91
|
// Initialize the token cache
|
|
85
92
|
this.tokenCache = new TokenCache(this.config, this.browserStorage, this.logger, this.browserCrypto);
|
|
86
93
|
}
|
|
@@ -147,7 +154,7 @@ var ClientApplication = /** @class */ (function () {
|
|
|
147
154
|
redirectResponse = void 0;
|
|
148
155
|
if (request && NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeExtensionProvider) && this.nativeExtensionProvider && !hash) {
|
|
149
156
|
this.logger.trace("handleRedirectPromise - acquiring token from native platform");
|
|
150
|
-
nativeClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.handleRedirectPromise, this.performanceClient, this.nativeExtensionProvider, request.accountId, request.correlationId);
|
|
157
|
+
nativeClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.handleRedirectPromise, this.performanceClient, this.nativeExtensionProvider, request.accountId, this.nativeInternalStorage, request.correlationId);
|
|
151
158
|
redirectResponse = nativeClient.handleRedirectPromise();
|
|
152
159
|
}
|
|
153
160
|
else {
|
|
@@ -219,13 +226,19 @@ var ClientApplication = /** @class */ (function () {
|
|
|
219
226
|
this.eventHandler.emitEvent(EventType.LOGIN_START, InteractionType.Redirect, request);
|
|
220
227
|
}
|
|
221
228
|
if (this.nativeExtensionProvider && this.canUseNative(request)) {
|
|
222
|
-
nativeClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenRedirect, this.performanceClient, this.nativeExtensionProvider, this.getNativeAccountId(request), request.correlationId);
|
|
229
|
+
nativeClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenRedirect, this.performanceClient, this.nativeExtensionProvider, this.getNativeAccountId(request), this.nativeInternalStorage, request.correlationId);
|
|
223
230
|
result = nativeClient.acquireTokenRedirect(request).catch(function (e) {
|
|
224
231
|
if (e instanceof NativeAuthError && e.isFatal()) {
|
|
225
232
|
_this.nativeExtensionProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt
|
|
226
233
|
var redirectClient = _this.createRedirectClient(request.correlationId);
|
|
227
234
|
return redirectClient.acquireToken(request);
|
|
228
235
|
}
|
|
236
|
+
else if (e instanceof InteractionRequiredAuthError) {
|
|
237
|
+
_this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow");
|
|
238
|
+
var redirectClient = _this.createRedirectClient(request.correlationId);
|
|
239
|
+
return redirectClient.acquireToken(request);
|
|
240
|
+
}
|
|
241
|
+
_this.browserStorage.setInteractionInProgress(false);
|
|
229
242
|
throw e;
|
|
230
243
|
});
|
|
231
244
|
}
|
|
@@ -281,7 +294,9 @@ var ClientApplication = /** @class */ (function () {
|
|
|
281
294
|
_this.browserStorage.setInteractionInProgress(false);
|
|
282
295
|
atPopupMeasurement.endMeasurement({
|
|
283
296
|
success: true,
|
|
284
|
-
isNativeBroker: true
|
|
297
|
+
isNativeBroker: true,
|
|
298
|
+
accessTokenSize: response.accessToken.length,
|
|
299
|
+
idTokenSize: response.idToken.length,
|
|
285
300
|
});
|
|
286
301
|
atPopupMeasurement.flushMeasurement();
|
|
287
302
|
return response;
|
|
@@ -291,6 +306,12 @@ var ClientApplication = /** @class */ (function () {
|
|
|
291
306
|
var popupClient = _this.createPopupClient(request.correlationId);
|
|
292
307
|
return popupClient.acquireToken(request);
|
|
293
308
|
}
|
|
309
|
+
else if (e instanceof InteractionRequiredAuthError) {
|
|
310
|
+
_this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow");
|
|
311
|
+
var popupClient = _this.createPopupClient(request.correlationId);
|
|
312
|
+
return popupClient.acquireToken(request);
|
|
313
|
+
}
|
|
314
|
+
_this.browserStorage.setInteractionInProgress(false);
|
|
294
315
|
throw e;
|
|
295
316
|
});
|
|
296
317
|
}
|
|
@@ -299,7 +320,9 @@ var ClientApplication = /** @class */ (function () {
|
|
|
299
320
|
result = popupClient.acquireToken(request);
|
|
300
321
|
}
|
|
301
322
|
return result.then(function (result) {
|
|
302
|
-
|
|
323
|
+
/*
|
|
324
|
+
* If logged in, emit acquire token events
|
|
325
|
+
*/
|
|
303
326
|
var isLoggingIn = loggedInAccounts.length < _this.getAllAccounts().length;
|
|
304
327
|
if (isLoggingIn) {
|
|
305
328
|
_this.eventHandler.emitEvent(EventType.LOGIN_SUCCESS, InteractionType.Popup, result);
|
|
@@ -308,7 +331,9 @@ var ClientApplication = /** @class */ (function () {
|
|
|
308
331
|
_this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Popup, result);
|
|
309
332
|
}
|
|
310
333
|
atPopupMeasurement.endMeasurement({
|
|
311
|
-
success: true
|
|
334
|
+
success: true,
|
|
335
|
+
accessTokenSize: result.accessToken.length,
|
|
336
|
+
idTokenSize: result.idToken.length,
|
|
312
337
|
});
|
|
313
338
|
atPopupMeasurement.flushMeasurement();
|
|
314
339
|
return result;
|
|
@@ -376,7 +401,9 @@ var ClientApplication = /** @class */ (function () {
|
|
|
376
401
|
_this.eventHandler.emitEvent(EventType.SSO_SILENT_SUCCESS, InteractionType.Silent, response);
|
|
377
402
|
ssoSilentMeasurement.endMeasurement({
|
|
378
403
|
success: true,
|
|
379
|
-
isNativeBroker: response.fromNativeBroker
|
|
404
|
+
isNativeBroker: response.fromNativeBroker,
|
|
405
|
+
accessTokenSize: response.accessToken.length,
|
|
406
|
+
idTokenSize: response.idToken.length
|
|
380
407
|
});
|
|
381
408
|
ssoSilentMeasurement.flushMeasurement();
|
|
382
409
|
return response;
|
|
@@ -425,6 +452,8 @@ var ClientApplication = /** @class */ (function () {
|
|
|
425
452
|
_this.hybridAuthCodeResponses.delete(hybridAuthCode_1);
|
|
426
453
|
atbcMeasurement.endMeasurement({
|
|
427
454
|
success: true,
|
|
455
|
+
accessTokenSize: result.accessToken.length,
|
|
456
|
+
idTokenSize: result.idToken.length,
|
|
428
457
|
isNativeBroker: result.fromNativeBroker
|
|
429
458
|
});
|
|
430
459
|
atbcMeasurement.flushMeasurement();
|
|
@@ -529,7 +558,9 @@ var ClientApplication = /** @class */ (function () {
|
|
|
529
558
|
.then(function (result) {
|
|
530
559
|
atbrtMeasurement.endMeasurement({
|
|
531
560
|
success: true,
|
|
532
|
-
fromCache: result.fromCache
|
|
561
|
+
fromCache: result.fromCache,
|
|
562
|
+
accessTokenSize: result.accessToken.length,
|
|
563
|
+
idTokenSize: result.idToken.length,
|
|
533
564
|
});
|
|
534
565
|
return result;
|
|
535
566
|
})
|
|
@@ -544,7 +575,9 @@ var ClientApplication = /** @class */ (function () {
|
|
|
544
575
|
.then(function (result) {
|
|
545
576
|
atbrtMeasurement.endMeasurement({
|
|
546
577
|
success: true,
|
|
547
|
-
fromCache: result.fromCache
|
|
578
|
+
fromCache: result.fromCache,
|
|
579
|
+
accessTokenSize: result.accessToken.length,
|
|
580
|
+
idTokenSize: result.idToken.length,
|
|
548
581
|
});
|
|
549
582
|
return result;
|
|
550
583
|
})
|
|
@@ -756,7 +789,7 @@ var ClientApplication = /** @class */ (function () {
|
|
|
756
789
|
if (!this.nativeExtensionProvider) {
|
|
757
790
|
throw BrowserAuthError.createNativeConnectionNotEstablishedError();
|
|
758
791
|
}
|
|
759
|
-
nativeClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, apiId, this.performanceClient, this.nativeExtensionProvider, accountId || this.getNativeAccountId(request), request.correlationId);
|
|
792
|
+
nativeClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, apiId, this.performanceClient, this.nativeExtensionProvider, accountId || this.getNativeAccountId(request), this.nativeInternalStorage, request.correlationId);
|
|
760
793
|
return [2 /*return*/, nativeClient.acquireToken(request)];
|
|
761
794
|
});
|
|
762
795
|
});
|
|
@@ -775,6 +808,7 @@ var ClientApplication = /** @class */ (function () {
|
|
|
775
808
|
switch (request.prompt) {
|
|
776
809
|
case PromptValue.NONE:
|
|
777
810
|
case PromptValue.CONSENT:
|
|
811
|
+
case PromptValue.LOGIN:
|
|
778
812
|
this.logger.trace("canUseNative: prompt is compatible with native flow");
|
|
779
813
|
break;
|
|
780
814
|
default:
|
|
@@ -802,21 +836,21 @@ var ClientApplication = /** @class */ (function () {
|
|
|
802
836
|
* @param correlationId
|
|
803
837
|
*/
|
|
804
838
|
ClientApplication.prototype.createPopupClient = function (correlationId) {
|
|
805
|
-
return new PopupClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeExtensionProvider, correlationId);
|
|
839
|
+
return new PopupClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeInternalStorage, this.nativeExtensionProvider, correlationId);
|
|
806
840
|
};
|
|
807
841
|
/**
|
|
808
|
-
* Returns new instance of the
|
|
842
|
+
* Returns new instance of the Redirect Interaction Client
|
|
809
843
|
* @param correlationId
|
|
810
844
|
*/
|
|
811
845
|
ClientApplication.prototype.createRedirectClient = function (correlationId) {
|
|
812
|
-
return new RedirectClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeExtensionProvider, correlationId);
|
|
846
|
+
return new RedirectClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeInternalStorage, this.nativeExtensionProvider, correlationId);
|
|
813
847
|
};
|
|
814
848
|
/**
|
|
815
849
|
* Returns new instance of the Silent Iframe Interaction Client
|
|
816
850
|
* @param correlationId
|
|
817
851
|
*/
|
|
818
852
|
ClientApplication.prototype.createSilentIframeClient = function (correlationId) {
|
|
819
|
-
return new SilentIframeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.ssoSilent, this.performanceClient, this.nativeExtensionProvider, correlationId);
|
|
853
|
+
return new SilentIframeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.ssoSilent, this.performanceClient, this.nativeInternalStorage, this.nativeExtensionProvider, correlationId);
|
|
820
854
|
};
|
|
821
855
|
/**
|
|
822
856
|
* Returns new instance of the Silent Cache Interaction Client
|