@azure/msal-browser 3.5.1-beta.1 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/IPublicClientApplication.d.ts +51 -51
- package/dist/app/IPublicClientApplication.mjs +102 -102
- package/dist/app/IPublicClientApplication.mjs.map +1 -1
- package/dist/app/PublicClientApplication.d.ts +269 -268
- package/dist/app/PublicClientApplication.d.ts.map +1 -1
- package/dist/app/PublicClientApplication.mjs +333 -333
- package/dist/app/PublicClientApplication.mjs.map +1 -1
- package/dist/app/PublicClientNext.d.ts +273 -273
- package/dist/app/PublicClientNext.mjs +351 -351
- package/dist/app/PublicClientNext.mjs.map +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.d.ts +62 -62
- package/dist/broker/nativeBroker/NativeMessageHandler.mjs +254 -254
- package/dist/broker/nativeBroker/NativeMessageHandler.mjs.map +1 -1
- package/dist/broker/nativeBroker/NativeRequest.d.ts +44 -44
- package/dist/broker/nativeBroker/NativeResponse.d.ts +48 -48
- package/dist/broker/nativeBroker/NativeStatusCodes.d.ts +7 -7
- package/dist/broker/nativeBroker/NativeStatusCodes.mjs +11 -11
- package/dist/broker/nativeBroker/NativeStatusCodes.mjs.map +1 -1
- package/dist/cache/AsyncMemoryStorage.d.ts +51 -51
- package/dist/cache/AsyncMemoryStorage.mjs +132 -132
- package/dist/cache/AsyncMemoryStorage.mjs.map +1 -1
- package/dist/cache/BrowserCacheManager.d.ts +395 -383
- package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
- package/dist/cache/BrowserCacheManager.mjs +1283 -1263
- package/dist/cache/BrowserCacheManager.mjs.map +1 -1
- package/dist/cache/BrowserStorage.d.ts +11 -11
- package/dist/cache/BrowserStorage.mjs +32 -32
- package/dist/cache/BrowserStorage.mjs.map +1 -1
- package/dist/cache/CryptoKeyStore.d.ts +18 -18
- package/dist/cache/CryptoKeyStore.mjs +40 -40
- package/dist/cache/CryptoKeyStore.mjs.map +1 -1
- package/dist/cache/DatabaseStorage.d.ts +56 -56
- package/dist/cache/DatabaseStorage.mjs +190 -190
- package/dist/cache/DatabaseStorage.mjs.map +1 -1
- package/dist/cache/IAsyncMemoryStorage.d.ts +27 -27
- package/dist/cache/ITokenCache.d.ts +11 -11
- package/dist/cache/IWindowStorage.d.ts +27 -27
- package/dist/cache/MemoryStorage.d.ts +11 -11
- package/dist/cache/MemoryStorage.mjs +31 -31
- package/dist/cache/MemoryStorage.mjs.map +1 -1
- package/dist/cache/TokenCache.d.ts +77 -77
- package/dist/cache/TokenCache.d.ts.map +1 -1
- package/dist/cache/TokenCache.mjs +223 -225
- package/dist/cache/TokenCache.mjs.map +1 -1
- package/dist/config/Configuration.d.ts +206 -206
- package/dist/config/Configuration.d.ts.map +1 -1
- package/dist/config/Configuration.mjs +128 -128
- package/dist/config/Configuration.mjs.map +1 -1
- package/dist/controllers/ControllerFactory.d.ts +4 -4
- package/dist/controllers/ControllerFactory.d.ts.map +1 -1
- package/dist/controllers/ControllerFactory.mjs +29 -29
- package/dist/controllers/ControllerFactory.mjs.map +1 -1
- package/dist/controllers/IController.d.ts +61 -61
- package/dist/controllers/NestedAppAuthController.d.ts +95 -95
- package/dist/controllers/NestedAppAuthController.mjs +334 -334
- package/dist/controllers/NestedAppAuthController.mjs.map +1 -1
- package/dist/controllers/StandardController.d.ts +407 -407
- package/dist/controllers/StandardController.d.ts.map +1 -1
- package/dist/controllers/StandardController.mjs +1307 -1294
- package/dist/controllers/StandardController.mjs.map +1 -1
- package/dist/controllers/UnknownOperatingContextController.d.ts +87 -87
- package/dist/controllers/UnknownOperatingContextController.mjs +264 -264
- package/dist/controllers/UnknownOperatingContextController.mjs.map +1 -1
- package/dist/crypto/BrowserCrypto.d.ts +44 -44
- package/dist/crypto/BrowserCrypto.mjs +93 -93
- package/dist/crypto/BrowserCrypto.mjs.map +1 -1
- package/dist/crypto/CryptoOps.d.ts +63 -63
- package/dist/crypto/CryptoOps.mjs +145 -145
- package/dist/crypto/CryptoOps.mjs.map +1 -1
- package/dist/crypto/PkceGenerator.d.ts +8 -8
- package/dist/crypto/PkceGenerator.mjs +54 -54
- package/dist/crypto/PkceGenerator.mjs.map +1 -1
- package/dist/crypto/SignedHttpRequest.d.ts +30 -30
- package/dist/crypto/SignedHttpRequest.mjs +39 -39
- package/dist/crypto/SignedHttpRequest.mjs.map +1 -1
- package/dist/encode/Base64Decode.d.ts +9 -9
- package/dist/encode/Base64Decode.mjs +36 -36
- package/dist/encode/Base64Decode.mjs.map +1 -1
- package/dist/encode/Base64Encode.d.ts +19 -19
- package/dist/encode/Base64Encode.mjs +43 -43
- package/dist/encode/Base64Encode.mjs.map +1 -1
- package/dist/error/BrowserAuthError.d.ts +250 -250
- package/dist/error/BrowserAuthError.mjs +258 -258
- package/dist/error/BrowserAuthError.mjs.map +1 -1
- package/dist/error/BrowserAuthErrorCodes.d.ts +45 -45
- package/dist/error/BrowserAuthErrorCodes.mjs +49 -49
- package/dist/error/BrowserAuthErrorCodes.mjs.map +1 -1
- package/dist/error/BrowserConfigurationAuthError.d.ts +33 -33
- package/dist/error/BrowserConfigurationAuthError.mjs +40 -40
- package/dist/error/BrowserConfigurationAuthError.mjs.map +1 -1
- package/dist/error/BrowserConfigurationAuthErrorCodes.d.ts +3 -3
- package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +7 -7
- package/dist/error/BrowserConfigurationAuthErrorCodes.mjs.map +1 -1
- package/dist/error/NativeAuthError.d.ts +29 -29
- package/dist/error/NativeAuthError.mjs +60 -60
- package/dist/error/NativeAuthError.mjs.map +1 -1
- package/dist/error/NativeAuthErrorCodes.d.ts +2 -2
- package/dist/error/NativeAuthErrorCodes.mjs +6 -6
- package/dist/error/NativeAuthErrorCodes.mjs.map +1 -1
- package/dist/error/NestedAppAuthError.d.ts +14 -14
- package/dist/error/NestedAppAuthError.mjs +23 -23
- package/dist/error/NestedAppAuthError.mjs.map +1 -1
- package/dist/event/EventHandler.d.ts +41 -41
- package/dist/event/EventHandler.mjs +119 -119
- package/dist/event/EventHandler.mjs.map +1 -1
- package/dist/event/EventMessage.d.ts +25 -25
- package/dist/event/EventMessage.mjs +68 -68
- package/dist/event/EventMessage.mjs.map +1 -1
- package/dist/event/EventType.d.ts +28 -28
- package/dist/event/EventType.mjs +31 -31
- package/dist/event/EventType.mjs.map +1 -1
- package/dist/index.d.ts +39 -39
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/interaction_client/BaseInteractionClient.d.ts +54 -54
- package/dist/interaction_client/BaseInteractionClient.mjs +152 -152
- package/dist/interaction_client/BaseInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.d.ts +4 -4
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +10 -10
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs.map +1 -1
- package/dist/interaction_client/NativeInteractionClient.d.ts +140 -140
- package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/NativeInteractionClient.mjs +541 -549
- package/dist/interaction_client/NativeInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/PopupClient.d.ts +105 -105
- package/dist/interaction_client/PopupClient.mjs +432 -432
- package/dist/interaction_client/PopupClient.mjs.map +1 -1
- package/dist/interaction_client/RedirectClient.d.ts +49 -49
- package/dist/interaction_client/RedirectClient.mjs +311 -311
- package/dist/interaction_client/RedirectClient.mjs.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.d.ts +23 -23
- package/dist/interaction_client/SilentAuthCodeClient.mjs +57 -57
- package/dist/interaction_client/SilentAuthCodeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentCacheClient.d.ts +24 -24
- package/dist/interaction_client/SilentCacheClient.mjs +61 -61
- package/dist/interaction_client/SilentCacheClient.mjs.map +1 -1
- package/dist/interaction_client/SilentIframeClient.d.ts +32 -32
- package/dist/interaction_client/SilentIframeClient.mjs +96 -96
- package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.d.ts +20 -20
- package/dist/interaction_client/SilentRefreshClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.mjs +47 -43
- package/dist/interaction_client/SilentRefreshClient.mjs.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.d.ts +54 -54
- package/dist/interaction_client/StandardInteractionClient.mjs +222 -222
- package/dist/interaction_client/StandardInteractionClient.mjs.map +1 -1
- package/dist/interaction_handler/InteractionHandler.d.ts +33 -33
- package/dist/interaction_handler/InteractionHandler.mjs +93 -93
- package/dist/interaction_handler/InteractionHandler.mjs.map +1 -1
- package/dist/interaction_handler/RedirectHandler.d.ts +32 -32
- package/dist/interaction_handler/RedirectHandler.mjs +134 -134
- package/dist/interaction_handler/RedirectHandler.mjs.map +1 -1
- package/dist/interaction_handler/SilentHandler.d.ts +13 -13
- package/dist/interaction_handler/SilentHandler.mjs +133 -133
- package/dist/interaction_handler/SilentHandler.mjs.map +1 -1
- package/dist/naa/AccountInfo.d.ts +11 -11
- package/dist/naa/AuthBridge.d.ts +8 -5
- package/dist/naa/AuthBridge.d.ts.map +1 -1
- package/dist/naa/AuthResult.d.ts +7 -0
- package/dist/naa/AuthResult.d.ts.map +1 -0
- package/dist/naa/BridgeCapabilities.d.ts +3 -3
- package/dist/naa/BridgeError.d.ts +9 -9
- package/dist/naa/BridgeError.mjs +7 -7
- package/dist/naa/BridgeError.mjs.map +1 -1
- package/dist/naa/BridgeProxy.d.ts +68 -72
- package/dist/naa/BridgeProxy.d.ts.map +1 -1
- package/dist/naa/BridgeProxy.mjs +155 -152
- package/dist/naa/BridgeProxy.mjs.map +1 -1
- package/dist/naa/BridgeRequest.d.ts +7 -6
- package/dist/naa/BridgeRequest.d.ts.map +1 -1
- package/dist/naa/BridgeRequestEnvelope.d.ts +12 -13
- package/dist/naa/BridgeRequestEnvelope.d.ts.map +1 -1
- package/dist/naa/BridgeResponseEnvelope.d.ts +13 -10
- package/dist/naa/BridgeResponseEnvelope.d.ts.map +1 -1
- package/dist/naa/BridgeStatusCode.d.ts +11 -10
- package/dist/naa/BridgeStatusCode.d.ts.map +1 -1
- package/dist/naa/BridgeStatusCode.mjs +15 -16
- package/dist/naa/BridgeStatusCode.mjs.map +1 -1
- package/dist/naa/IBridgeProxy.d.ts +10 -12
- package/dist/naa/IBridgeProxy.d.ts.map +1 -1
- package/dist/naa/{InitializeBridgeResponse.d.ts → InitContext.d.ts} +7 -7
- package/dist/naa/InitContext.d.ts.map +1 -0
- package/dist/naa/TokenRequest.d.ts +18 -19
- package/dist/naa/TokenRequest.d.ts.map +1 -1
- package/dist/naa/TokenResponse.d.ts +13 -15
- package/dist/naa/TokenResponse.d.ts.map +1 -1
- package/dist/naa/mapping/NestedAppAuthAdapter.d.ts +23 -23
- package/dist/naa/mapping/NestedAppAuthAdapter.d.ts.map +1 -1
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs +141 -141
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs.map +1 -1
- package/dist/navigation/INavigationClient.d.ts +16 -16
- package/dist/navigation/NavigationClient.d.ts +22 -22
- package/dist/navigation/NavigationClient.mjs +40 -40
- package/dist/navigation/NavigationClient.mjs.map +1 -1
- package/dist/navigation/NavigationOptions.d.ts +12 -12
- package/dist/network/FetchClient.d.ts +26 -26
- package/dist/network/FetchClient.mjs +99 -99
- package/dist/network/FetchClient.mjs.map +1 -1
- package/dist/operatingcontext/BaseOperatingContext.d.ts +41 -40
- package/dist/operatingcontext/BaseOperatingContext.d.ts.map +1 -1
- package/dist/operatingcontext/BaseOperatingContext.mjs +96 -45
- package/dist/operatingcontext/BaseOperatingContext.mjs.map +1 -1
- package/dist/operatingcontext/StandardOperatingContext.d.ts +25 -25
- package/dist/operatingcontext/StandardOperatingContext.mjs +43 -43
- package/dist/operatingcontext/StandardOperatingContext.mjs.map +1 -1
- package/dist/operatingcontext/TeamsAppOperatingContext.d.ts +32 -32
- package/dist/operatingcontext/TeamsAppOperatingContext.mjs +85 -85
- package/dist/operatingcontext/TeamsAppOperatingContext.mjs.map +1 -1
- package/dist/operatingcontext/UnknownOperatingContext.d.ts +25 -25
- package/dist/operatingcontext/UnknownOperatingContext.mjs +42 -42
- package/dist/operatingcontext/UnknownOperatingContext.mjs.map +1 -1
- package/dist/packageMetadata.d.ts +2 -2
- package/dist/packageMetadata.d.ts.map +1 -1
- package/dist/packageMetadata.mjs +4 -4
- package/dist/packageMetadata.mjs.map +1 -1
- package/dist/request/AuthorizationCodeRequest.d.ts +8 -8
- package/dist/request/AuthorizationUrlRequest.d.ts +8 -8
- package/dist/request/ClearCacheRequest.d.ts +10 -10
- package/dist/request/EndSessionPopupRequest.d.ts +18 -18
- package/dist/request/EndSessionRequest.d.ts +15 -15
- package/dist/request/PopupRequest.d.ts +34 -34
- package/dist/request/PopupWindowAttributes.d.ts +15 -15
- package/dist/request/RedirectRequest.d.ts +35 -35
- package/dist/request/SilentRequest.d.ts +32 -32
- package/dist/request/SsoSilentRequest.d.ts +29 -29
- package/dist/response/AuthenticationResult.d.ts +4 -4
- package/dist/response/ResponseHandler.d.ts +7 -7
- package/dist/response/ResponseHandler.mjs +36 -36
- package/dist/response/ResponseHandler.mjs.map +1 -1
- package/dist/telemetry/BrowserPerformanceClient.d.ts +34 -36
- package/dist/telemetry/BrowserPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/BrowserPerformanceClient.mjs +163 -126
- package/dist/telemetry/BrowserPerformanceClient.mjs.map +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.d.ts +21 -21
- package/dist/telemetry/BrowserPerformanceMeasurement.mjs +92 -92
- package/dist/telemetry/BrowserPerformanceMeasurement.mjs.map +1 -1
- package/dist/utils/BrowserConstants.d.ts +180 -176
- package/dist/utils/BrowserConstants.d.ts.map +1 -1
- package/dist/utils/BrowserConstants.mjs +213 -205
- package/dist/utils/BrowserConstants.mjs.map +1 -1
- package/dist/utils/BrowserProtocolUtils.d.ts +11 -11
- package/dist/utils/BrowserProtocolUtils.mjs +21 -21
- package/dist/utils/BrowserProtocolUtils.mjs.map +1 -1
- package/dist/utils/BrowserUtils.d.ts +56 -56
- package/dist/utils/BrowserUtils.mjs +125 -125
- package/dist/utils/BrowserUtils.mjs.map +1 -1
- package/lib/msal-browser.cjs +18304 -17929
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +18304 -17929
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +66 -68
- package/package.json +103 -102
- package/src/app/PublicClientApplication.ts +2 -1
- package/src/cache/BrowserCacheManager.ts +38 -23
- package/src/cache/DatabaseStorage.ts +1 -1
- package/src/cache/TokenCache.ts +34 -29
- package/src/config/Configuration.ts +1 -1
- package/src/controllers/ControllerFactory.ts +3 -5
- package/src/controllers/StandardController.ts +53 -26
- package/src/crypto/CryptoOps.ts +1 -1
- package/src/crypto/SignedHttpRequest.ts +1 -1
- package/src/index.ts +1 -0
- package/src/interaction_client/BaseInteractionClient.ts +2 -2
- package/src/interaction_client/NativeInteractionClient.ts +24 -20
- package/src/interaction_client/PopupClient.ts +1 -1
- package/src/interaction_client/RedirectClient.ts +3 -3
- package/src/interaction_client/SilentAuthCodeClient.ts +1 -1
- package/src/interaction_client/SilentRefreshClient.ts +8 -0
- package/src/interaction_client/StandardInteractionClient.ts +1 -1
- package/src/interaction_handler/SilentHandler.ts +2 -2
- package/src/naa/AuthBridge.ts +3 -2
- package/src/naa/AuthResult.ts +12 -0
- package/src/naa/BridgeProxy.ts +64 -71
- package/src/naa/BridgeRequest.ts +6 -2
- package/src/naa/BridgeRequestEnvelope.ts +1 -13
- package/src/naa/BridgeResponseEnvelope.ts +5 -7
- package/src/naa/BridgeStatusCode.ts +12 -10
- package/src/naa/IBridgeProxy.ts +3 -14
- package/src/naa/{InitializeBridgeResponse.ts → InitContext.ts} +1 -1
- package/src/naa/TokenRequest.ts +1 -2
- package/src/naa/TokenResponse.ts +1 -4
- package/src/naa/mapping/NestedAppAuthAdapter.ts +19 -19
- package/src/operatingcontext/BaseOperatingContext.ts +64 -7
- package/src/packageMetadata.ts +1 -1
- package/src/telemetry/BrowserPerformanceClient.ts +95 -42
- package/src/utils/BrowserConstants.ts +11 -0
- package/dist/naa/AccountRequests.d.ts +0 -10
- package/dist/naa/AccountRequests.d.ts.map +0 -1
- package/dist/naa/InitializeBridgeResponse.d.ts.map +0 -1
- package/src/naa/AccountRequests.ts +0 -16
|
@@ -283,7 +283,7 @@ export abstract class BaseInteractionClient {
|
|
|
283
283
|
this.logger.verbose(
|
|
284
284
|
"Creating discovered authority with request authority"
|
|
285
285
|
);
|
|
286
|
-
return
|
|
286
|
+
return AuthorityFactory.createDiscoveredInstance(
|
|
287
287
|
requestAuthority,
|
|
288
288
|
this.config.system.networkClient,
|
|
289
289
|
this.browserStorage,
|
|
@@ -295,7 +295,7 @@ export abstract class BaseInteractionClient {
|
|
|
295
295
|
this.logger.verbose(
|
|
296
296
|
"Creating discovered authority with configured authority"
|
|
297
297
|
);
|
|
298
|
-
return
|
|
298
|
+
return AuthorityFactory.createDiscoveredInstance(
|
|
299
299
|
this.config.auth.authority,
|
|
300
300
|
this.config.system.networkClient,
|
|
301
301
|
this.browserStorage,
|
|
@@ -33,7 +33,9 @@ import {
|
|
|
33
33
|
invokeAsync,
|
|
34
34
|
createAuthError,
|
|
35
35
|
AuthErrorCodes,
|
|
36
|
+
updateAccountTenantProfileData,
|
|
36
37
|
CacheHelpers,
|
|
38
|
+
buildAccountToCache,
|
|
37
39
|
} from "@azure/msal-common";
|
|
38
40
|
import { BaseInteractionClient } from "./BaseInteractionClient";
|
|
39
41
|
import { BrowserConfiguration } from "../config/Configuration";
|
|
@@ -372,7 +374,7 @@ export class NativeInteractionClient extends BaseInteractionClient {
|
|
|
372
374
|
reqTimestamp
|
|
373
375
|
);
|
|
374
376
|
this.browserStorage.setInteractionInProgress(false);
|
|
375
|
-
return result;
|
|
377
|
+
return await result;
|
|
376
378
|
} catch (e) {
|
|
377
379
|
this.browserStorage.setInteractionInProgress(false);
|
|
378
380
|
throw e;
|
|
@@ -420,14 +422,19 @@ export class NativeInteractionClient extends BaseInteractionClient {
|
|
|
420
422
|
response,
|
|
421
423
|
idTokenClaims
|
|
422
424
|
);
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
425
|
+
|
|
426
|
+
const baseAccount = buildAccountToCache(
|
|
427
|
+
this.browserStorage,
|
|
428
|
+
authority,
|
|
429
|
+
homeAccountIdentifier,
|
|
430
|
+
idTokenClaims,
|
|
431
|
+
base64Decode,
|
|
432
|
+
response.client_info,
|
|
433
|
+
undefined, // environment
|
|
434
|
+
idTokenClaims.tid,
|
|
435
|
+
undefined, // auth code payload
|
|
436
|
+
response.account.id,
|
|
437
|
+
this.logger
|
|
431
438
|
);
|
|
432
439
|
|
|
433
440
|
// generate authenticationResult
|
|
@@ -435,13 +442,13 @@ export class NativeInteractionClient extends BaseInteractionClient {
|
|
|
435
442
|
response,
|
|
436
443
|
request,
|
|
437
444
|
idTokenClaims,
|
|
438
|
-
|
|
445
|
+
baseAccount,
|
|
439
446
|
authority.canonicalAuthority,
|
|
440
447
|
reqTimestamp
|
|
441
448
|
);
|
|
442
449
|
|
|
443
450
|
// cache accounts and tokens in the appropriate storage
|
|
444
|
-
this.cacheAccount(
|
|
451
|
+
this.cacheAccount(baseAccount);
|
|
445
452
|
this.cacheNativeTokens(
|
|
446
453
|
response,
|
|
447
454
|
request,
|
|
@@ -533,7 +540,7 @@ export class NativeInteractionClient extends BaseInteractionClient {
|
|
|
533
540
|
if (!request.keyId) {
|
|
534
541
|
throw createClientAuthError(ClientAuthErrorCodes.keyIdMissing);
|
|
535
542
|
}
|
|
536
|
-
return
|
|
543
|
+
return popTokenGenerator.signPopToken(
|
|
537
544
|
response.access_token,
|
|
538
545
|
request.keyId,
|
|
539
546
|
shrParameters
|
|
@@ -580,14 +587,11 @@ export class NativeInteractionClient extends BaseInteractionClient {
|
|
|
580
587
|
idTokenClaims.tid ||
|
|
581
588
|
Constants.EMPTY_STRING;
|
|
582
589
|
|
|
583
|
-
const
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
: accountEntity;
|
|
589
|
-
|
|
590
|
-
const accountInfo = fullAccountEntity.getAccountInfo();
|
|
590
|
+
const accountInfo: AccountInfo | null = updateAccountTenantProfileData(
|
|
591
|
+
accountEntity.getAccountInfo(),
|
|
592
|
+
undefined, // tenantProfile optional
|
|
593
|
+
idTokenClaims
|
|
594
|
+
);
|
|
591
595
|
|
|
592
596
|
// generate PoP token as needed
|
|
593
597
|
const responseAccessToken = await this.generatePopAccessToken(
|
|
@@ -339,7 +339,7 @@ export class PopupClient extends StandardInteractionClient {
|
|
|
339
339
|
this.browserCrypto,
|
|
340
340
|
validRequest.state
|
|
341
341
|
);
|
|
342
|
-
return nativeInteractionClient.acquireToken({
|
|
342
|
+
return await nativeInteractionClient.acquireToken({
|
|
343
343
|
...validRequest,
|
|
344
344
|
state: userRequestState,
|
|
345
345
|
prompt: undefined, // Server should handle the prompt, ideally native broker can do this part silently
|
|
@@ -254,7 +254,7 @@ export class RedirectClient extends StandardInteractionClient {
|
|
|
254
254
|
this.logger.verbose(
|
|
255
255
|
"NavigateToLoginRequestUrl set to false, handling response"
|
|
256
256
|
);
|
|
257
|
-
return this.handleResponse(
|
|
257
|
+
return await this.handleResponse(
|
|
258
258
|
serverParams,
|
|
259
259
|
serverTelemetryManager
|
|
260
260
|
);
|
|
@@ -313,7 +313,7 @@ export class RedirectClient extends StandardInteractionClient {
|
|
|
313
313
|
|
|
314
314
|
// If navigateInternal implementation returns false, handle the hash now
|
|
315
315
|
if (!processHashOnRedirect) {
|
|
316
|
-
return this.handleResponse(
|
|
316
|
+
return await this.handleResponse(
|
|
317
317
|
serverParams,
|
|
318
318
|
serverTelemetryManager
|
|
319
319
|
);
|
|
@@ -483,7 +483,7 @@ export class RedirectClient extends StandardInteractionClient {
|
|
|
483
483
|
this.logger,
|
|
484
484
|
this.performanceClient
|
|
485
485
|
);
|
|
486
|
-
return
|
|
486
|
+
return interactionHandler.handleCodeResponse(serverParams, state);
|
|
487
487
|
}
|
|
488
488
|
|
|
489
489
|
/**
|
|
@@ -114,7 +114,7 @@ export class SilentAuthCodeClient extends StandardInteractionClient {
|
|
|
114
114
|
);
|
|
115
115
|
|
|
116
116
|
// Handle auth code parameters from request
|
|
117
|
-
return invokeAsync(
|
|
117
|
+
return await invokeAsync(
|
|
118
118
|
interactionHandler.handleCodeResponseFromServer.bind(
|
|
119
119
|
interactionHandler
|
|
120
120
|
),
|
|
@@ -44,6 +44,14 @@ export class SilentRefreshClient extends StandardInteractionClient {
|
|
|
44
44
|
...request,
|
|
45
45
|
...baseRequest,
|
|
46
46
|
};
|
|
47
|
+
|
|
48
|
+
if (request.redirectUri) {
|
|
49
|
+
// Make sure any passed redirectUri is converted to an absolute URL - redirectUri is not a required parameter for refresh token redemption so only include if explicitly provided
|
|
50
|
+
silentRequest.redirectUri = this.getRedirectUri(
|
|
51
|
+
request.redirectUri
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
47
55
|
const serverTelemetryManager = this.initializeServerTelemetryManager(
|
|
48
56
|
ApiId.acquireTokenSilent_silentFlow
|
|
49
57
|
);
|
|
@@ -319,7 +319,7 @@ export abstract class StandardInteractionClient extends BaseInteractionClient {
|
|
|
319
319
|
userAuthority,
|
|
320
320
|
requestAzureCloudOptions || this.config.auth.azureCloudOptions
|
|
321
321
|
);
|
|
322
|
-
return
|
|
322
|
+
return invokeAsync(
|
|
323
323
|
AuthorityFactory.createDiscoveredInstance.bind(AuthorityFactory),
|
|
324
324
|
PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance,
|
|
325
325
|
this.logger,
|
|
@@ -40,7 +40,7 @@ export async function initiateAuthRequest(
|
|
|
40
40
|
throw createBrowserAuthError(BrowserAuthErrorCodes.emptyNavigateUri);
|
|
41
41
|
}
|
|
42
42
|
if (navigateFrameWait) {
|
|
43
|
-
return
|
|
43
|
+
return invokeAsync(
|
|
44
44
|
loadFrame,
|
|
45
45
|
PerformanceEvents.SilentHandlerLoadFrame,
|
|
46
46
|
logger,
|
|
@@ -203,7 +203,7 @@ function createHiddenIframe(): HTMLIFrameElement {
|
|
|
203
203
|
"sandbox",
|
|
204
204
|
"allow-scripts allow-same-origin allow-forms"
|
|
205
205
|
);
|
|
206
|
-
document.
|
|
206
|
+
document.body.appendChild(authFrame);
|
|
207
207
|
|
|
208
208
|
return authFrame;
|
|
209
209
|
}
|
package/src/naa/AuthBridge.ts
CHANGED
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
export type AuthBridgeResponse = string | { data: string };
|
|
6
7
|
export interface AuthBridge {
|
|
7
8
|
addEventListener: (
|
|
8
9
|
eventName: string,
|
|
9
|
-
callback: (response:
|
|
10
|
+
callback: (response: AuthBridgeResponse) => void
|
|
10
11
|
) => void;
|
|
11
12
|
postMessage: (message: string) => void;
|
|
12
13
|
removeEventListener: (
|
|
13
14
|
eventName: string,
|
|
14
|
-
callback: (response:
|
|
15
|
+
callback: (response: AuthBridgeResponse) => void
|
|
15
16
|
) => void;
|
|
16
17
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { AccountInfo } from "./AccountInfo";
|
|
7
|
+
import { TokenResponse } from "./TokenResponse";
|
|
8
|
+
|
|
9
|
+
export type AuthResult = {
|
|
10
|
+
token: TokenResponse;
|
|
11
|
+
account: AccountInfo;
|
|
12
|
+
};
|
package/src/naa/BridgeProxy.ts
CHANGED
|
@@ -4,20 +4,17 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { AccountInfo } from "./AccountInfo";
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
AccountByLocalIdRequest,
|
|
10
|
-
AccountByUsernameRequest,
|
|
11
|
-
} from "./AccountRequests";
|
|
12
|
-
import { AuthBridge } from "./AuthBridge";
|
|
7
|
+
import { AuthBridge, AuthBridgeResponse } from "./AuthBridge";
|
|
8
|
+
import { AuthResult } from "./AuthResult";
|
|
13
9
|
import { BridgeCapabilities } from "./BridgeCapabilities";
|
|
10
|
+
import { BridgeError } from "./BridgeError";
|
|
14
11
|
import { BridgeRequest } from "./BridgeRequest";
|
|
15
12
|
import { BridgeRequestEnvelope, BridgeMethods } from "./BridgeRequestEnvelope";
|
|
16
13
|
import { BridgeResponseEnvelope } from "./BridgeResponseEnvelope";
|
|
14
|
+
import { BridgeStatusCode } from "./BridgeStatusCode";
|
|
17
15
|
import { IBridgeProxy } from "./IBridgeProxy";
|
|
18
|
-
import {
|
|
16
|
+
import { InitContext } from "./InitContext";
|
|
19
17
|
import { TokenRequest } from "./TokenRequest";
|
|
20
|
-
import { TokenResponse } from "./TokenResponse";
|
|
21
18
|
|
|
22
19
|
declare global {
|
|
23
20
|
interface Window {
|
|
@@ -31,8 +28,7 @@ declare global {
|
|
|
31
28
|
* platform broker
|
|
32
29
|
*/
|
|
33
30
|
export class BridgeProxy implements IBridgeProxy {
|
|
34
|
-
|
|
35
|
-
static bridgeRequests: any[] = [];
|
|
31
|
+
static bridgeRequests: BridgeRequest[] = [];
|
|
36
32
|
static crypto: Crypto;
|
|
37
33
|
sdkName: string;
|
|
38
34
|
sdkVersion: string;
|
|
@@ -44,7 +40,7 @@ export class BridgeProxy implements IBridgeProxy {
|
|
|
44
40
|
* @remarks This method will be called by the create factory method
|
|
45
41
|
* @remarks If the bridge is not available, this method will throw an error
|
|
46
42
|
*/
|
|
47
|
-
protected static async initializeNestedAppAuthBridge(): Promise<
|
|
43
|
+
protected static async initializeNestedAppAuthBridge(): Promise<InitContext> {
|
|
48
44
|
if (window === undefined) {
|
|
49
45
|
throw new Error("window is undefined");
|
|
50
46
|
}
|
|
@@ -60,9 +56,11 @@ export class BridgeProxy implements IBridgeProxy {
|
|
|
60
56
|
|
|
61
57
|
window.nestedAppAuthBridge.addEventListener(
|
|
62
58
|
"message",
|
|
63
|
-
(response:
|
|
59
|
+
(response: AuthBridgeResponse) => {
|
|
60
|
+
const responsePayload =
|
|
61
|
+
typeof response === "string" ? response : response.data;
|
|
64
62
|
const responseEnvelope: BridgeResponseEnvelope =
|
|
65
|
-
JSON.parse(
|
|
63
|
+
JSON.parse(responsePayload);
|
|
66
64
|
const request = BridgeProxy.bridgeRequests.find(
|
|
67
65
|
(element) =>
|
|
68
66
|
element.requestId === responseEnvelope.requestId
|
|
@@ -73,22 +71,22 @@ export class BridgeProxy implements IBridgeProxy {
|
|
|
73
71
|
1
|
|
74
72
|
);
|
|
75
73
|
if (responseEnvelope.success) {
|
|
76
|
-
request.resolve(responseEnvelope
|
|
74
|
+
request.resolve(responseEnvelope);
|
|
77
75
|
} else {
|
|
78
|
-
request.reject(responseEnvelope.
|
|
76
|
+
request.reject(responseEnvelope.error);
|
|
79
77
|
}
|
|
80
78
|
}
|
|
81
79
|
}
|
|
82
80
|
);
|
|
83
81
|
|
|
84
|
-
const
|
|
82
|
+
const bridgeResponse = await new Promise<BridgeResponseEnvelope>(
|
|
85
83
|
(resolve, reject) => {
|
|
86
84
|
const message: BridgeRequestEnvelope = {
|
|
87
85
|
messageType: "NestedAppAuthRequest",
|
|
88
86
|
method: "GetInitContext",
|
|
89
87
|
requestId: BridgeProxy.getRandomId(),
|
|
90
88
|
};
|
|
91
|
-
const request: BridgeRequest
|
|
89
|
+
const request: BridgeRequest = {
|
|
92
90
|
requestId: message.requestId,
|
|
93
91
|
method: message.method,
|
|
94
92
|
resolve: resolve,
|
|
@@ -101,7 +99,9 @@ export class BridgeProxy implements IBridgeProxy {
|
|
|
101
99
|
}
|
|
102
100
|
);
|
|
103
101
|
|
|
104
|
-
return
|
|
102
|
+
return BridgeProxy.validateBridgeResultOrThrow(
|
|
103
|
+
bridgeResponse.initContext
|
|
104
|
+
);
|
|
105
105
|
} catch (error) {
|
|
106
106
|
window.console.log(error);
|
|
107
107
|
throw error;
|
|
@@ -115,51 +115,37 @@ export class BridgeProxy implements IBridgeProxy {
|
|
|
115
115
|
/**
|
|
116
116
|
* getTokenInteractive - Attempts to get a token interactively from the bridge
|
|
117
117
|
* @param request A token request
|
|
118
|
-
* @returns a promise that resolves to
|
|
118
|
+
* @returns a promise that resolves to an auth result or rejects with a BridgeError
|
|
119
119
|
*/
|
|
120
|
-
public getTokenInteractive(request: TokenRequest): Promise<
|
|
121
|
-
return this.
|
|
120
|
+
public getTokenInteractive(request: TokenRequest): Promise<AuthResult> {
|
|
121
|
+
return this.getToken("GetTokenPopup", request);
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
125
|
* getTokenSilent Attempts to get a token silently from the bridge
|
|
126
126
|
* @param request A token request
|
|
127
|
-
* @returns a promise that resolves to
|
|
127
|
+
* @returns a promise that resolves to an auth result or rejects with a BridgeError
|
|
128
128
|
*/
|
|
129
|
-
public getTokenSilent(request: TokenRequest): Promise<
|
|
130
|
-
return this.
|
|
129
|
+
public getTokenSilent(request: TokenRequest): Promise<AuthResult> {
|
|
130
|
+
return this.getToken("GetToken", request);
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
let method: BridgeMethods = "GetAccountByHomeId";
|
|
145
|
-
|
|
146
|
-
if ((request as AccountByHomeIdRequest).homeAccountId !== undefined) {
|
|
147
|
-
method = "GetAccountByHomeId";
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if ((request as AccountByLocalIdRequest).localAccountId !== undefined) {
|
|
151
|
-
method = "GetAccountByLocalId";
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
if ((request as AccountByUsernameRequest).username !== undefined) {
|
|
155
|
-
method = "GetAccountByUsername";
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
return this.sendRequest<AccountInfo>(method, request);
|
|
133
|
+
private async getToken(
|
|
134
|
+
requestType: BridgeMethods,
|
|
135
|
+
request: TokenRequest
|
|
136
|
+
): Promise<AuthResult> {
|
|
137
|
+
const result = await this.sendRequest(requestType, {
|
|
138
|
+
tokenParams: request,
|
|
139
|
+
});
|
|
140
|
+
return {
|
|
141
|
+
token: BridgeProxy.validateBridgeResultOrThrow(result.token),
|
|
142
|
+
account: BridgeProxy.validateBridgeResultOrThrow(result.account),
|
|
143
|
+
};
|
|
159
144
|
}
|
|
160
145
|
|
|
161
|
-
public getActiveAccount(): Promise<AccountInfo> {
|
|
162
|
-
|
|
146
|
+
public async getActiveAccount(): Promise<AccountInfo> {
|
|
147
|
+
const result = await this.sendRequest("GetActiveAccount");
|
|
148
|
+
return BridgeProxy.validateBridgeResultOrThrow(result.account);
|
|
163
149
|
}
|
|
164
150
|
|
|
165
151
|
public getHostCapabilities(): BridgeCapabilities | null {
|
|
@@ -171,36 +157,43 @@ export class BridgeProxy implements IBridgeProxy {
|
|
|
171
157
|
* @param request A token request
|
|
172
158
|
* @returns a promise that resolves to a response of provided type or rejects with a BridgeError
|
|
173
159
|
*/
|
|
174
|
-
private sendRequest
|
|
160
|
+
private sendRequest(
|
|
175
161
|
method: BridgeMethods,
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
| AccountByHomeIdRequest
|
|
179
|
-
| AccountByLocalIdRequest
|
|
180
|
-
| AccountByUsernameRequest
|
|
181
|
-
| undefined
|
|
182
|
-
): Promise<TResponse> {
|
|
162
|
+
requestParams?: Partial<BridgeRequestEnvelope>
|
|
163
|
+
): Promise<BridgeResponseEnvelope> {
|
|
183
164
|
const message: BridgeRequestEnvelope = {
|
|
184
165
|
messageType: "NestedAppAuthRequest",
|
|
185
166
|
method: method,
|
|
186
167
|
requestId: BridgeProxy.getRandomId(),
|
|
187
|
-
|
|
168
|
+
...requestParams,
|
|
188
169
|
};
|
|
189
170
|
|
|
190
|
-
const promise = new Promise<
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
171
|
+
const promise = new Promise<BridgeResponseEnvelope>(
|
|
172
|
+
(resolve, reject) => {
|
|
173
|
+
const request: BridgeRequest = {
|
|
174
|
+
requestId: message.requestId,
|
|
175
|
+
method: message.method,
|
|
176
|
+
resolve: resolve,
|
|
177
|
+
reject: reject,
|
|
178
|
+
};
|
|
179
|
+
BridgeProxy.bridgeRequests.push(request);
|
|
180
|
+
window.nestedAppAuthBridge.postMessage(JSON.stringify(message));
|
|
181
|
+
}
|
|
182
|
+
);
|
|
200
183
|
|
|
201
184
|
return promise;
|
|
202
185
|
}
|
|
203
186
|
|
|
187
|
+
private static validateBridgeResultOrThrow<T>(input: T | undefined): T {
|
|
188
|
+
if (input === undefined) {
|
|
189
|
+
const bridgeError: BridgeError = {
|
|
190
|
+
status: BridgeStatusCode.NestedAppAuthUnavailable,
|
|
191
|
+
};
|
|
192
|
+
throw bridgeError;
|
|
193
|
+
}
|
|
194
|
+
return input;
|
|
195
|
+
}
|
|
196
|
+
|
|
204
197
|
/**
|
|
205
198
|
* Private constructor for BridgeProxy
|
|
206
199
|
* @param sdkName The name of the SDK being used to make requests on behalf of the app
|
package/src/naa/BridgeRequest.ts
CHANGED
|
@@ -3,10 +3,14 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
import { BridgeResponseEnvelope } from "./BridgeResponseEnvelope";
|
|
7
|
+
|
|
8
|
+
export type BridgeRequest = {
|
|
7
9
|
requestId: string;
|
|
8
10
|
method: string;
|
|
9
|
-
resolve: (
|
|
11
|
+
resolve: (
|
|
12
|
+
value: BridgeResponseEnvelope | PromiseLike<BridgeResponseEnvelope>
|
|
13
|
+
) => void;
|
|
10
14
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
15
|
reject: (reason?: any) => void;
|
|
12
16
|
};
|
|
@@ -4,19 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { TokenRequest } from "./TokenRequest";
|
|
7
|
-
import {
|
|
8
|
-
AccountByHomeIdRequest,
|
|
9
|
-
AccountByLocalIdRequest,
|
|
10
|
-
AccountByUsernameRequest,
|
|
11
|
-
} from "./AccountRequests";
|
|
12
7
|
|
|
13
8
|
export type BridgeMethods =
|
|
14
9
|
| "GetToken"
|
|
15
10
|
| "GetActiveAccount"
|
|
16
11
|
| "GetAllAccounts"
|
|
17
|
-
| "GetAccountByHomeId"
|
|
18
|
-
| "GetAccountByLocalId"
|
|
19
|
-
| "GetAccountByUsername"
|
|
20
12
|
| "GetInitContext"
|
|
21
13
|
| "GetTokenPopup";
|
|
22
14
|
|
|
@@ -27,11 +19,7 @@ export type BridgeRequestEnvelope = {
|
|
|
27
19
|
clientLibrary?: string;
|
|
28
20
|
clientLibraryVersion?: string;
|
|
29
21
|
requestId: string;
|
|
30
|
-
|
|
31
|
-
| TokenRequest
|
|
32
|
-
| AccountByHomeIdRequest
|
|
33
|
-
| AccountByLocalIdRequest
|
|
34
|
-
| AccountByUsernameRequest;
|
|
22
|
+
tokenParams?: TokenRequest;
|
|
35
23
|
};
|
|
36
24
|
|
|
37
25
|
export function isBridgeRequestEnvelope(
|
|
@@ -6,16 +6,14 @@
|
|
|
6
6
|
import { BridgeError } from "./BridgeError";
|
|
7
7
|
import { TokenResponse } from "./TokenResponse";
|
|
8
8
|
import { AccountInfo } from "./AccountInfo";
|
|
9
|
-
import {
|
|
9
|
+
import { InitContext } from "./InitContext";
|
|
10
10
|
|
|
11
11
|
export type BridgeResponseEnvelope = {
|
|
12
12
|
messageType: "NestedAppAuthResponse";
|
|
13
13
|
requestId: string;
|
|
14
14
|
success: boolean; // false if body is error
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
| AccountInfo[]
|
|
20
|
-
| InitializeBridgeResponse;
|
|
15
|
+
token?: TokenResponse;
|
|
16
|
+
error?: BridgeError;
|
|
17
|
+
account?: AccountInfo;
|
|
18
|
+
initContext?: InitContext;
|
|
21
19
|
};
|
|
@@ -3,13 +3,15 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
6
|
+
export const BridgeStatusCode = {
|
|
7
|
+
UserInteractionRequired: "USER_INTERACTION_REQUIRED",
|
|
8
|
+
UserCancel: "USER_CANCEL",
|
|
9
|
+
NoNetwork: "NO_NETWORK",
|
|
10
|
+
TransientError: "TRANSIENT_ERROR",
|
|
11
|
+
PersistentError: "PERSISTENT_ERROR",
|
|
12
|
+
Disabled: "DISABLED",
|
|
13
|
+
AccountUnavailable: "ACCOUNT_UNAVAILABLE",
|
|
14
|
+
NestedAppAuthUnavailable: "NESTED_APP_AUTH_UNAVAILABLE", // NAA is unavailable in the current context, can retry with standard browser based auth
|
|
15
|
+
} as const;
|
|
16
|
+
export type BridgeStatusCode =
|
|
17
|
+
(typeof BridgeStatusCode)[keyof typeof BridgeStatusCode];
|
package/src/naa/IBridgeProxy.ts
CHANGED
|
@@ -4,24 +4,13 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { AccountInfo } from "./AccountInfo";
|
|
7
|
-
import {
|
|
8
|
-
AccountByHomeIdRequest,
|
|
9
|
-
AccountByLocalIdRequest,
|
|
10
|
-
AccountByUsernameRequest,
|
|
11
|
-
} from "./AccountRequests";
|
|
7
|
+
import { AuthResult } from "./AuthResult";
|
|
12
8
|
import { BridgeCapabilities } from "./BridgeCapabilities";
|
|
13
9
|
import { TokenRequest } from "./TokenRequest";
|
|
14
|
-
import { TokenResponse } from "./TokenResponse";
|
|
15
10
|
|
|
16
11
|
export interface IBridgeProxy {
|
|
17
|
-
getTokenInteractive(request: TokenRequest): Promise<
|
|
18
|
-
getTokenSilent(request: TokenRequest): Promise<
|
|
19
|
-
getAccountInfo(
|
|
20
|
-
request:
|
|
21
|
-
| AccountByHomeIdRequest
|
|
22
|
-
| AccountByLocalIdRequest
|
|
23
|
-
| AccountByUsernameRequest
|
|
24
|
-
): Promise<AccountInfo>;
|
|
12
|
+
getTokenInteractive(request: TokenRequest): Promise<AuthResult>;
|
|
13
|
+
getTokenSilent(request: TokenRequest): Promise<AuthResult>;
|
|
25
14
|
getActiveAccount(): Promise<AccountInfo>;
|
|
26
15
|
getHostCapabilities(): BridgeCapabilities | null;
|
|
27
16
|
}
|
package/src/naa/TokenRequest.ts
CHANGED
|
@@ -4,12 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export type TokenRequest = {
|
|
7
|
-
|
|
7
|
+
platformBrokerId?: string; // Account identifier used by OneAuth
|
|
8
8
|
clientId: string;
|
|
9
9
|
authority?: string;
|
|
10
10
|
scope: string;
|
|
11
11
|
correlationId: string;
|
|
12
|
-
nonce?: string;
|
|
13
12
|
claims?: string;
|
|
14
13
|
state?: string;
|
|
15
14
|
reqCnf?: string; // Having OneAuth own the keypair is better for hardware token binding support
|
package/src/naa/TokenResponse.ts
CHANGED
|
@@ -3,15 +3,12 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { AccountInfo } from "./AccountInfo";
|
|
7
|
-
|
|
8
6
|
export type TokenResponse = {
|
|
9
7
|
access_token: string;
|
|
10
|
-
account: AccountInfo;
|
|
11
8
|
expires_in: number;
|
|
12
9
|
id_token: string;
|
|
13
10
|
properties: TokenResponseProperties | null;
|
|
14
|
-
scope
|
|
11
|
+
scope?: string;
|
|
15
12
|
shr?: string; // token binding enabled at native layer it is the access token, not the signing keys
|
|
16
13
|
extendedLifetimeToken?: boolean;
|
|
17
14
|
authority?: string;
|