@azure/msal-browser 2.36.0 → 3.0.0-alpha.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/LICENSE +21 -21
- package/README.md +213 -213
- package/dist/app/IPublicClientApplication.d.ts.map +1 -1
- package/dist/app/IPublicClientApplication.js +33 -33
- package/dist/app/IPublicClientApplication.js.map +1 -1
- package/dist/app/PublicClientApplication.d.ts +198 -24
- package/dist/app/PublicClientApplication.d.ts.map +1 -1
- package/dist/app/PublicClientApplication.js +263 -220
- package/dist/app/PublicClientApplication.js.map +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.d.ts +5 -4
- package/dist/broker/nativeBroker/NativeMessageHandler.d.ts.map +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.js +118 -124
- package/dist/broker/nativeBroker/NativeMessageHandler.js.map +1 -1
- package/dist/broker/nativeBroker/NativeRequest.d.ts +4 -4
- package/dist/broker/nativeBroker/NativeRequest.d.ts.map +1 -1
- package/dist/broker/nativeBroker/NativeResponse.d.ts +4 -4
- package/dist/broker/nativeBroker/NativeResponse.d.ts.map +1 -1
- package/dist/cache/AsyncMemoryStorage.d.ts.map +1 -1
- package/dist/cache/AsyncMemoryStorage.js +83 -152
- package/dist/cache/AsyncMemoryStorage.js.map +1 -1
- package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
- package/dist/cache/BrowserCacheManager.js +420 -412
- package/dist/cache/BrowserCacheManager.js.map +1 -1
- package/dist/cache/BrowserStorage.d.ts.map +1 -1
- package/dist/cache/BrowserStorage.js +19 -19
- package/dist/cache/BrowserStorage.js.map +1 -1
- package/dist/cache/CryptoKeyStore.d.ts.map +1 -1
- package/dist/cache/CryptoKeyStore.js +26 -36
- package/dist/cache/CryptoKeyStore.js.map +1 -1
- package/dist/cache/DatabaseStorage.d.ts.map +1 -1
- package/dist/cache/DatabaseStorage.js +127 -191
- package/dist/cache/DatabaseStorage.js.map +1 -1
- package/dist/cache/ITokenCache.d.ts.map +1 -1
- package/dist/cache/MemoryStorage.d.ts.map +1 -1
- package/dist/cache/MemoryStorage.js +18 -19
- package/dist/cache/MemoryStorage.js.map +1 -1
- package/dist/cache/TokenCache.d.ts +1 -1
- package/dist/cache/TokenCache.d.ts.map +1 -1
- package/dist/cache/TokenCache.js +55 -49
- package/dist/cache/TokenCache.js.map +1 -1
- package/dist/config/Configuration.d.ts +8 -8
- package/dist/config/Configuration.d.ts.map +1 -1
- package/dist/config/Configuration.js +53 -31
- package/dist/config/Configuration.js.map +1 -1
- package/dist/controllers/ControllerFactory.d.ts +10 -0
- package/dist/controllers/ControllerFactory.d.ts.map +1 -0
- package/dist/controllers/ControllerFactory.js +47 -0
- package/dist/controllers/ControllerFactory.js.map +1 -0
- package/dist/controllers/IController.d.ts +67 -0
- package/dist/controllers/IController.d.ts.map +1 -0
- package/dist/{app/ClientApplication.d.ts → controllers/StandardController.d.ts} +96 -15
- package/dist/controllers/StandardController.d.ts.map +1 -0
- package/dist/controllers/StandardController.js +1299 -0
- package/dist/controllers/StandardController.js.map +1 -0
- package/dist/crypto/BrowserCrypto.d.ts.map +1 -1
- package/dist/crypto/BrowserCrypto.js +36 -60
- package/dist/crypto/BrowserCrypto.js.map +1 -1
- package/dist/crypto/CryptoOps.d.ts +1 -1
- package/dist/crypto/CryptoOps.d.ts.map +1 -1
- package/dist/crypto/CryptoOps.js +93 -151
- package/dist/crypto/CryptoOps.js.map +1 -1
- package/dist/crypto/GuidGenerator.d.ts.map +1 -1
- package/dist/crypto/GuidGenerator.js +36 -25
- package/dist/crypto/GuidGenerator.js.map +1 -1
- package/dist/crypto/ISubtleCrypto.d.ts.map +1 -1
- package/dist/crypto/ModernBrowserCrypto.d.ts.map +1 -1
- package/dist/crypto/ModernBrowserCrypto.js +20 -44
- package/dist/crypto/ModernBrowserCrypto.js.map +1 -1
- package/dist/crypto/MsBrowserCrypto.d.ts.map +1 -1
- package/dist/crypto/MsBrowserCrypto.js +65 -89
- package/dist/crypto/MsBrowserCrypto.js.map +1 -1
- package/dist/crypto/MsrBrowserCrypto.d.ts.map +1 -1
- package/dist/crypto/MsrBrowserCrypto.js +23 -47
- package/dist/crypto/MsrBrowserCrypto.js.map +1 -1
- package/dist/crypto/PkceGenerator.d.ts.map +1 -1
- package/dist/crypto/PkceGenerator.js +28 -49
- package/dist/crypto/PkceGenerator.js.map +1 -1
- package/dist/crypto/SignedHttpRequest.d.ts +1 -1
- package/dist/crypto/SignedHttpRequest.d.ts.map +1 -1
- package/dist/crypto/SignedHttpRequest.js +15 -37
- package/dist/crypto/SignedHttpRequest.js.map +1 -1
- package/dist/encode/Base64Decode.d.ts.map +1 -1
- package/dist/encode/Base64Decode.js +32 -33
- package/dist/encode/Base64Decode.js.map +1 -1
- package/dist/encode/Base64Encode.d.ts.map +1 -1
- package/dist/encode/Base64Encode.js +34 -35
- package/dist/encode/Base64Encode.js.map +1 -1
- package/dist/error/BrowserAuthError.d.ts +1 -1
- package/dist/error/BrowserAuthError.d.ts.map +1 -1
- package/dist/error/BrowserAuthError.js +161 -163
- package/dist/error/BrowserAuthError.js.map +1 -1
- package/dist/error/BrowserConfigurationAuthError.d.ts.map +1 -1
- package/dist/error/BrowserConfigurationAuthError.js +32 -36
- package/dist/error/BrowserConfigurationAuthError.js.map +1 -1
- package/dist/error/NativeAuthError.d.ts +1 -1
- package/dist/error/NativeAuthError.d.ts.map +1 -1
- package/dist/error/NativeAuthError.js +26 -27
- package/dist/error/NativeAuthError.js.map +1 -1
- package/dist/event/EventHandler.d.ts.map +1 -1
- package/dist/event/EventHandler.js +33 -33
- package/dist/event/EventHandler.js.map +1 -1
- package/dist/event/EventMessage.d.ts +5 -5
- package/dist/event/EventMessage.d.ts.map +1 -1
- package/dist/event/EventMessage.js +18 -14
- package/dist/event/EventMessage.js.map +1 -1
- package/dist/event/EventType.js +1 -1
- package/dist/event/EventType.js.map +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/BaseInteractionClient.js +92 -123
- package/dist/interaction_client/BaseInteractionClient.js.map +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.d.ts.map +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +6 -10
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js.map +1 -1
- package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/NativeInteractionClient.js +336 -393
- package/dist/interaction_client/NativeInteractionClient.js.map +1 -1
- package/dist/interaction_client/PopupClient.d.ts +1 -1
- package/dist/interaction_client/PopupClient.d.ts.map +1 -1
- package/dist/interaction_client/PopupClient.js +224 -246
- package/dist/interaction_client/PopupClient.js.map +1 -1
- package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
- package/dist/interaction_client/RedirectClient.js +244 -292
- package/dist/interaction_client/RedirectClient.js.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.js +50 -63
- 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 +50 -81
- package/dist/interaction_client/SilentCacheClient.js.map +1 -1
- package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentIframeClient.js +107 -125
- 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 +44 -72
- 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 +144 -180
- package/dist/interaction_client/StandardInteractionClient.js.map +1 -1
- package/dist/interaction_handler/InteractionHandler.d.ts +1 -1
- package/dist/interaction_handler/InteractionHandler.d.ts.map +1 -1
- package/dist/interaction_handler/InteractionHandler.js +84 -110
- package/dist/interaction_handler/InteractionHandler.js.map +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 +105 -122
- package/dist/interaction_handler/RedirectHandler.js.map +1 -1
- package/dist/interaction_handler/SilentHandler.d.ts.map +1 -1
- package/dist/interaction_handler/SilentHandler.js +76 -65
- package/dist/interaction_handler/SilentHandler.js.map +1 -1
- package/dist/internals.js +1 -1
- package/dist/internals.js.map +1 -1
- package/dist/navigation/NavigationClient.d.ts.map +1 -1
- package/dist/navigation/NavigationClient.js +11 -14
- package/dist/navigation/NavigationClient.js.map +1 -1
- package/dist/navigation/NavigationOptions.d.ts +1 -1
- package/dist/navigation/NavigationOptions.d.ts.map +1 -1
- package/dist/network/FetchClient.d.ts.map +1 -1
- package/dist/network/FetchClient.js +66 -96
- package/dist/network/FetchClient.js.map +1 -1
- package/dist/network/XhrClient.d.ts.map +1 -1
- package/dist/network/XhrClient.js +38 -51
- package/dist/network/XhrClient.js.map +1 -1
- package/dist/operatingcontext/BaseOperatingContext.d.ts +41 -0
- package/dist/operatingcontext/BaseOperatingContext.d.ts.map +1 -0
- package/dist/operatingcontext/BaseOperatingContext.js +53 -0
- package/dist/operatingcontext/BaseOperatingContext.js.map +1 -0
- package/dist/operatingcontext/StandardOperatingContext.d.ts +26 -0
- package/dist/operatingcontext/StandardOperatingContext.d.ts.map +1 -0
- package/dist/operatingcontext/StandardOperatingContext.js +50 -0
- package/dist/operatingcontext/StandardOperatingContext.js.map +1 -0
- package/dist/operatingcontext/TeamsAppOperatingContext.d.ts +26 -0
- package/dist/operatingcontext/TeamsAppOperatingContext.d.ts.map +1 -0
- package/dist/operatingcontext/TeamsAppOperatingContext.js +49 -0
- package/dist/operatingcontext/TeamsAppOperatingContext.js.map +1 -0
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.d.ts.map +1 -1
- package/dist/packageMetadata.js +3 -3
- package/dist/packageMetadata.js.map +1 -1
- package/dist/request/AuthorizationCodeRequest.d.ts +1 -1
- package/dist/request/AuthorizationCodeRequest.d.ts.map +1 -1
- package/dist/request/AuthorizationUrlRequest.d.ts +1 -1
- package/dist/request/AuthorizationUrlRequest.d.ts.map +1 -1
- package/dist/request/EndSessionPopupRequest.d.ts +1 -1
- package/dist/request/EndSessionPopupRequest.d.ts.map +1 -1
- package/dist/request/EndSessionRequest.d.ts +1 -1
- package/dist/request/EndSessionRequest.d.ts.map +1 -1
- package/dist/request/PopupRequest.d.ts +1 -1
- package/dist/request/PopupRequest.d.ts.map +1 -1
- package/dist/request/PopupWindowAttributes.d.ts +3 -3
- package/dist/request/PopupWindowAttributes.d.ts.map +1 -1
- package/dist/request/RedirectRequest.d.ts +1 -1
- package/dist/request/RedirectRequest.d.ts.map +1 -1
- package/dist/request/SilentRequest.d.ts +1 -1
- package/dist/request/SilentRequest.d.ts.map +1 -1
- package/dist/request/SsoSilentRequest.d.ts +1 -1
- package/dist/request/SsoSilentRequest.d.ts.map +1 -1
- package/dist/telemetry/BrowserPerformanceClient.d.ts +1 -1
- package/dist/telemetry/BrowserPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/BrowserPerformanceClient.js +62 -57
- package/dist/telemetry/BrowserPerformanceClient.js.map +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.d.ts.map +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.js +30 -31
- package/dist/telemetry/BrowserPerformanceMeasurement.js.map +1 -1
- package/dist/utils/BrowserConstants.d.ts.map +1 -1
- package/dist/utils/BrowserConstants.js +10 -10
- package/dist/utils/BrowserConstants.js.map +1 -1
- package/dist/utils/BrowserProtocolUtils.d.ts +1 -1
- package/dist/utils/BrowserProtocolUtils.d.ts.map +1 -1
- package/dist/utils/BrowserProtocolUtils.js +9 -12
- package/dist/utils/BrowserProtocolUtils.js.map +1 -1
- package/dist/utils/BrowserStringUtils.d.ts.map +1 -1
- package/dist/utils/BrowserStringUtils.js +83 -49
- package/dist/utils/BrowserStringUtils.js.map +1 -1
- package/dist/utils/BrowserUtils.d.ts.map +1 -1
- package/dist/utils/BrowserUtils.js +51 -49
- package/dist/utils/BrowserUtils.js.map +1 -1
- package/dist/utils/MathUtils.d.ts.map +1 -1
- package/dist/utils/MathUtils.js +6 -9
- package/dist/utils/MathUtils.js.map +1 -1
- package/node_modules/@azure/msal-common/LICENSE +21 -0
- package/node_modules/@azure/msal-common/README.md +62 -0
- package/node_modules/@azure/msal-common/dist/account/AccountInfo.d.ts +32 -0
- package/node_modules/@azure/msal-common/dist/account/AccountInfo.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/account/AuthToken.d.ts +21 -0
- package/node_modules/@azure/msal-common/dist/account/AuthToken.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/account/AuthToken.js +56 -0
- package/node_modules/@azure/msal-common/dist/account/AuthToken.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/account/CcsCredential.d.ts +9 -0
- package/node_modules/@azure/msal-common/dist/account/CcsCredential.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/account/CcsCredential.js +14 -0
- package/node_modules/@azure/msal-common/dist/account/CcsCredential.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/account/ClientCredentials.d.ts +15 -0
- package/node_modules/@azure/msal-common/dist/account/ClientCredentials.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/account/ClientInfo.d.ts +20 -0
- package/node_modules/@azure/msal-common/dist/account/ClientInfo.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/account/ClientInfo.js +46 -0
- package/node_modules/@azure/msal-common/dist/account/ClientInfo.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/account/DecodedAuthToken.d.ts +9 -0
- package/node_modules/@azure/msal-common/dist/account/DecodedAuthToken.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/account/TokenClaims.d.ts +66 -0
- package/node_modules/@azure/msal-common/dist/account/TokenClaims.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/authority/Authority.d.ts +216 -0
- package/node_modules/@azure/msal-common/dist/authority/Authority.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/authority/Authority.js +688 -0
- package/node_modules/@azure/msal-common/dist/authority/Authority.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/authority/AuthorityFactory.d.ts +31 -0
- package/node_modules/@azure/msal-common/dist/authority/AuthorityFactory.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/authority/AuthorityFactory.js +58 -0
- package/node_modules/@azure/msal-common/dist/authority/AuthorityFactory.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/authority/AuthorityMetadata.d.ts +623 -0
- package/node_modules/@azure/msal-common/dist/authority/AuthorityMetadata.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/authority/AuthorityMetadata.js +881 -0
- package/node_modules/@azure/msal-common/dist/authority/AuthorityMetadata.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/authority/AuthorityOptions.d.ts +19 -0
- package/node_modules/@azure/msal-common/dist/authority/AuthorityOptions.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/authority/AuthorityOptions.js +24 -0
- package/node_modules/@azure/msal-common/dist/authority/AuthorityOptions.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/authority/AuthorityType.d.ts +10 -0
- package/node_modules/@azure/msal-common/dist/authority/AuthorityType.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/authority/AuthorityType.js +19 -0
- package/node_modules/@azure/msal-common/dist/authority/AuthorityType.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/authority/AzureRegion.d.ts +2 -0
- package/node_modules/@azure/msal-common/dist/authority/AzureRegion.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/authority/AzureRegionConfiguration.d.ts +6 -0
- package/node_modules/@azure/msal-common/dist/authority/AzureRegionConfiguration.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/authority/CloudDiscoveryMetadata.d.ts +6 -0
- package/node_modules/@azure/msal-common/dist/authority/CloudDiscoveryMetadata.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryErrorResponse.d.ts +14 -0
- package/node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryErrorResponse.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryErrorResponse.js +13 -0
- package/node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryErrorResponse.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryResponse.d.ts +10 -0
- package/node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryResponse.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryResponse.js +13 -0
- package/node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryResponse.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/authority/ImdsOptions.d.ts +6 -0
- package/node_modules/@azure/msal-common/dist/authority/ImdsOptions.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/authority/OpenIdConfigResponse.d.ts +12 -0
- package/node_modules/@azure/msal-common/dist/authority/OpenIdConfigResponse.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/authority/OpenIdConfigResponse.js +15 -0
- package/node_modules/@azure/msal-common/dist/authority/OpenIdConfigResponse.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/authority/ProtocolMode.d.ts +8 -0
- package/node_modules/@azure/msal-common/dist/authority/ProtocolMode.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/authority/ProtocolMode.js +17 -0
- package/node_modules/@azure/msal-common/dist/authority/ProtocolMode.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/authority/RegionDiscovery.d.ts +31 -0
- package/node_modules/@azure/msal-common/dist/authority/RegionDiscovery.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/authority/RegionDiscovery.js +116 -0
- package/node_modules/@azure/msal-common/dist/authority/RegionDiscovery.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/authority/RegionDiscoveryMetadata.d.ts +7 -0
- package/node_modules/@azure/msal-common/dist/authority/RegionDiscoveryMetadata.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts +16 -0
- package/node_modules/@azure/msal-common/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/CacheManager.d.ts +444 -0
- package/node_modules/@azure/msal-common/dist/cache/CacheManager.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/CacheManager.js +1024 -0
- package/node_modules/@azure/msal-common/dist/cache/CacheManager.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/AccessTokenEntity.d.ts +57 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/AccessTokenEntity.js +123 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/AccessTokenEntity.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/AccountEntity.d.ts +100 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/AccountEntity.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/AccountEntity.js +259 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/AccountEntity.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/AppMetadataEntity.d.ts +40 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/AppMetadataEntity.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/AppMetadataEntity.js +73 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/AppMetadataEntity.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/AuthorityMetadataEntity.d.ts +48 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/AuthorityMetadataEntity.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/AuthorityMetadataEntity.js +85 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/AuthorityMetadataEntity.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/CacheRecord.d.ts +14 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/CacheRecord.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/CacheRecord.js +18 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/CacheRecord.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/CredentialEntity.d.ts +89 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/CredentialEntity.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/CredentialEntity.js +144 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/CredentialEntity.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/IdTokenEntity.d.ts +35 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/IdTokenEntity.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/IdTokenEntity.js +64 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/IdTokenEntity.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/RefreshTokenEntity.d.ts +37 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/RefreshTokenEntity.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/RefreshTokenEntity.js +67 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/RefreshTokenEntity.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/ServerTelemetryEntity.d.ts +13 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/ServerTelemetryEntity.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/ServerTelemetryEntity.js +34 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/ServerTelemetryEntity.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/ThrottlingEntity.d.ts +14 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/ThrottlingEntity.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/ThrottlingEntity.js +30 -0
- package/node_modules/@azure/msal-common/dist/cache/entities/ThrottlingEntity.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/interface/ICacheManager.d.ts +166 -0
- package/node_modules/@azure/msal-common/dist/cache/interface/ICacheManager.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/interface/ICachePlugin.d.ts +6 -0
- package/node_modules/@azure/msal-common/dist/cache/interface/ICachePlugin.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/interface/ISerializableTokenCache.d.ts +5 -0
- package/node_modules/@azure/msal-common/dist/cache/interface/ISerializableTokenCache.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/persistence/TokenCacheContext.d.ts +24 -0
- package/node_modules/@azure/msal-common/dist/cache/persistence/TokenCacheContext.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/persistence/TokenCacheContext.js +30 -0
- package/node_modules/@azure/msal-common/dist/cache/persistence/TokenCacheContext.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/cache/utils/CacheTypes.d.ts +63 -0
- package/node_modules/@azure/msal-common/dist/cache/utils/CacheTypes.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/client/AuthorizationCodeClient.d.ts +72 -0
- package/node_modules/@azure/msal-common/dist/client/AuthorizationCodeClient.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/client/AuthorizationCodeClient.js +453 -0
- package/node_modules/@azure/msal-common/dist/client/AuthorizationCodeClient.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/client/BaseClient.d.ts +51 -0
- package/node_modules/@azure/msal-common/dist/client/BaseClient.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/client/BaseClient.js +107 -0
- package/node_modules/@azure/msal-common/dist/client/BaseClient.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/client/RefreshTokenClient.d.ts +35 -0
- package/node_modules/@azure/msal-common/dist/client/RefreshTokenClient.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/client/RefreshTokenClient.js +260 -0
- package/node_modules/@azure/msal-common/dist/client/RefreshTokenClient.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/client/SilentFlowClient.d.ts +25 -0
- package/node_modules/@azure/msal-common/dist/client/SilentFlowClient.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/client/SilentFlowClient.js +108 -0
- package/node_modules/@azure/msal-common/dist/client/SilentFlowClient.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/config/AppTokenProvider.d.ts +39 -0
- package/node_modules/@azure/msal-common/dist/config/AppTokenProvider.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/config/ClientConfiguration.d.ts +134 -0
- package/node_modules/@azure/msal-common/dist/config/ClientConfiguration.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/config/ClientConfiguration.js +101 -0
- package/node_modules/@azure/msal-common/dist/config/ClientConfiguration.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/crypto/ICrypto.d.ts +63 -0
- package/node_modules/@azure/msal-common/dist/crypto/ICrypto.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/crypto/ICrypto.js +49 -0
- package/node_modules/@azure/msal-common/dist/crypto/ICrypto.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/crypto/IGuidGenerator.d.ts +5 -0
- package/node_modules/@azure/msal-common/dist/crypto/IGuidGenerator.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/crypto/JoseHeader.d.ts +22 -0
- package/node_modules/@azure/msal-common/dist/crypto/JoseHeader.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/crypto/JoseHeader.js +44 -0
- package/node_modules/@azure/msal-common/dist/crypto/JoseHeader.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/crypto/PopTokenGenerator.d.ts +58 -0
- package/node_modules/@azure/msal-common/dist/crypto/PopTokenGenerator.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/crypto/PopTokenGenerator.js +92 -0
- package/node_modules/@azure/msal-common/dist/crypto/PopTokenGenerator.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/crypto/SignedHttpRequest.d.ts +12 -0
- package/node_modules/@azure/msal-common/dist/crypto/SignedHttpRequest.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/error/AuthError.d.ts +48 -0
- package/node_modules/@azure/msal-common/dist/error/AuthError.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/error/AuthError.js +58 -0
- package/node_modules/@azure/msal-common/dist/error/AuthError.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/error/ClientAuthError.d.ts +413 -0
- package/node_modules/@azure/msal-common/dist/error/ClientAuthError.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/error/ClientAuthError.js +526 -0
- package/node_modules/@azure/msal-common/dist/error/ClientAuthError.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/error/ClientConfigurationError.d.ts +199 -0
- package/node_modules/@azure/msal-common/dist/error/ClientConfigurationError.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/error/ClientConfigurationError.js +256 -0
- package/node_modules/@azure/msal-common/dist/error/ClientConfigurationError.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/error/InteractionRequiredAuthError.d.ts +60 -0
- package/node_modules/@azure/msal-common/dist/error/InteractionRequiredAuthError.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/error/InteractionRequiredAuthError.js +86 -0
- package/node_modules/@azure/msal-common/dist/error/InteractionRequiredAuthError.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/error/JoseHeaderError.d.ts +29 -0
- package/node_modules/@azure/msal-common/dist/error/JoseHeaderError.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/error/JoseHeaderError.js +46 -0
- package/node_modules/@azure/msal-common/dist/error/JoseHeaderError.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/error/ServerError.d.ts +8 -0
- package/node_modules/@azure/msal-common/dist/error/ServerError.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/error/ServerError.js +21 -0
- package/node_modules/@azure/msal-common/dist/error/ServerError.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/index.cjs.js +8975 -0
- package/node_modules/@azure/msal-common/dist/index.cjs.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/index.d.ts +94 -0
- package/node_modules/@azure/msal-common/dist/index.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/index.js +54 -0
- package/node_modules/@azure/msal-common/dist/index.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/logger/Logger.d.ts +96 -0
- package/node_modules/@azure/msal-common/dist/logger/Logger.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/logger/Logger.js +205 -0
- package/node_modules/@azure/msal-common/dist/logger/Logger.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/network/INetworkModule.d.ts +30 -0
- package/node_modules/@azure/msal-common/dist/network/INetworkModule.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/network/INetworkModule.js +21 -0
- package/node_modules/@azure/msal-common/dist/network/INetworkModule.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/network/NetworkManager.d.ts +33 -0
- package/node_modules/@azure/msal-common/dist/network/NetworkManager.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/network/NetworkManager.js +42 -0
- package/node_modules/@azure/msal-common/dist/network/NetworkManager.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/network/RequestThumbprint.d.ts +17 -0
- package/node_modules/@azure/msal-common/dist/network/RequestThumbprint.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/network/ThrottlingUtils.d.ts +42 -0
- package/node_modules/@azure/msal-common/dist/network/ThrottlingUtils.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/network/ThrottlingUtils.js +102 -0
- package/node_modules/@azure/msal-common/dist/network/ThrottlingUtils.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/packageMetadata.d.ts +3 -0
- package/node_modules/@azure/msal-common/dist/packageMetadata.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/packageMetadata.js +8 -0
- package/node_modules/@azure/msal-common/dist/packageMetadata.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/request/AuthenticationHeaderParser.d.ts +20 -0
- package/node_modules/@azure/msal-common/dist/request/AuthenticationHeaderParser.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/request/AuthenticationHeaderParser.js +63 -0
- package/node_modules/@azure/msal-common/dist/request/AuthenticationHeaderParser.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/request/BaseAuthRequest.d.ts +38 -0
- package/node_modules/@azure/msal-common/dist/request/BaseAuthRequest.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/request/CommonAuthorizationCodeRequest.d.ts +28 -0
- package/node_modules/@azure/msal-common/dist/request/CommonAuthorizationCodeRequest.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/request/CommonAuthorizationUrlRequest.d.ts +51 -0
- package/node_modules/@azure/msal-common/dist/request/CommonAuthorizationUrlRequest.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/request/CommonClientCredentialRequest.d.ts +18 -0
- package/node_modules/@azure/msal-common/dist/request/CommonClientCredentialRequest.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/request/CommonDeviceCodeRequest.d.ts +22 -0
- package/node_modules/@azure/msal-common/dist/request/CommonDeviceCodeRequest.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/request/CommonEndSessionRequest.d.ts +22 -0
- package/node_modules/@azure/msal-common/dist/request/CommonEndSessionRequest.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/request/CommonOnBehalfOfRequest.d.ts +14 -0
- package/node_modules/@azure/msal-common/dist/request/CommonOnBehalfOfRequest.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/request/CommonRefreshTokenRequest.d.ts +20 -0
- package/node_modules/@azure/msal-common/dist/request/CommonRefreshTokenRequest.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/request/CommonSilentFlowRequest.d.ts +19 -0
- package/node_modules/@azure/msal-common/dist/request/CommonSilentFlowRequest.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/request/CommonUsernamePasswordRequest.d.ts +18 -0
- package/node_modules/@azure/msal-common/dist/request/CommonUsernamePasswordRequest.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/request/NativeRequest.d.ts +20 -0
- package/node_modules/@azure/msal-common/dist/request/NativeRequest.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/request/NativeSignOutRequest.d.ts +6 -0
- package/node_modules/@azure/msal-common/dist/request/NativeSignOutRequest.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/request/RequestParameterBuilder.d.ts +217 -0
- package/node_modules/@azure/msal-common/dist/request/RequestParameterBuilder.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/request/RequestParameterBuilder.js +385 -0
- package/node_modules/@azure/msal-common/dist/request/RequestParameterBuilder.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/request/RequestValidator.d.ts +34 -0
- package/node_modules/@azure/msal-common/dist/request/RequestValidator.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/request/RequestValidator.js +92 -0
- package/node_modules/@azure/msal-common/dist/request/RequestValidator.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/request/ScopeSet.d.ts +89 -0
- package/node_modules/@azure/msal-common/dist/request/ScopeSet.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/request/ScopeSet.js +207 -0
- package/node_modules/@azure/msal-common/dist/request/ScopeSet.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/response/AuthenticationResult.d.ts +40 -0
- package/node_modules/@azure/msal-common/dist/response/AuthenticationResult.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/response/AuthorizationCodePayload.d.ts +14 -0
- package/node_modules/@azure/msal-common/dist/response/AuthorizationCodePayload.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/response/DeviceCodeResponse.d.ts +26 -0
- package/node_modules/@azure/msal-common/dist/response/DeviceCodeResponse.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/response/ExternalTokenResponse.d.ts +16 -0
- package/node_modules/@azure/msal-common/dist/response/ExternalTokenResponse.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/response/IMDSBadResponse.d.ts +5 -0
- package/node_modules/@azure/msal-common/dist/response/IMDSBadResponse.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/response/ResponseHandler.d.ts +73 -0
- package/node_modules/@azure/msal-common/dist/response/ResponseHandler.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/response/ResponseHandler.js +325 -0
- package/node_modules/@azure/msal-common/dist/response/ResponseHandler.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/response/ServerAuthorizationCodeResponse.d.ts +26 -0
- package/node_modules/@azure/msal-common/dist/response/ServerAuthorizationCodeResponse.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/response/ServerAuthorizationTokenResponse.d.ts +45 -0
- package/node_modules/@azure/msal-common/dist/response/ServerAuthorizationTokenResponse.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/telemetry/performance/IPerformanceClient.d.ts +43 -0
- package/node_modules/@azure/msal-common/dist/telemetry/performance/IPerformanceClient.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/telemetry/performance/IPerformanceMeasurement.d.ts +6 -0
- package/node_modules/@azure/msal-common/dist/telemetry/performance/IPerformanceMeasurement.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceClient.d.ts +190 -0
- package/node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceClient.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceClient.js +413 -0
- package/node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceClient.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceEvent.d.ts +440 -0
- package/node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceEvent.js +232 -0
- package/node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceEvent.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/telemetry/performance/StubPerformanceClient.d.ts +20 -0
- package/node_modules/@azure/msal-common/dist/telemetry/performance/StubPerformanceClient.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/telemetry/performance/StubPerformanceClient.js +43 -0
- package/node_modules/@azure/msal-common/dist/telemetry/performance/StubPerformanceClient.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/telemetry/server/ServerTelemetryManager.d.ts +66 -0
- package/node_modules/@azure/msal-common/dist/telemetry/server/ServerTelemetryManager.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/telemetry/server/ServerTelemetryManager.js +206 -0
- package/node_modules/@azure/msal-common/dist/telemetry/server/ServerTelemetryManager.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/telemetry/server/ServerTelemetryRequest.d.ts +9 -0
- package/node_modules/@azure/msal-common/dist/telemetry/server/ServerTelemetryRequest.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/url/IUri.d.ts +13 -0
- package/node_modules/@azure/msal-common/dist/url/IUri.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/url/UrlString.d.ts +71 -0
- package/node_modules/@azure/msal-common/dist/url/UrlString.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/url/UrlString.js +252 -0
- package/node_modules/@azure/msal-common/dist/url/UrlString.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/utils/Constants.d.ts +332 -0
- package/node_modules/@azure/msal-common/dist/utils/Constants.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/utils/Constants.js +378 -0
- package/node_modules/@azure/msal-common/dist/utils/Constants.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/utils/MsalTypes.d.ts +7 -0
- package/node_modules/@azure/msal-common/dist/utils/MsalTypes.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/utils/ProtocolUtils.d.ts +43 -0
- package/node_modules/@azure/msal-common/dist/utils/ProtocolUtils.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/utils/ProtocolUtils.js +80 -0
- package/node_modules/@azure/msal-common/dist/utils/ProtocolUtils.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/utils/StringUtils.d.ts +54 -0
- package/node_modules/@azure/msal-common/dist/utils/StringUtils.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/utils/StringUtils.js +131 -0
- package/node_modules/@azure/msal-common/dist/utils/StringUtils.js.map +1 -0
- package/node_modules/@azure/msal-common/dist/utils/TimeUtils.d.ts +28 -0
- package/node_modules/@azure/msal-common/dist/utils/TimeUtils.d.ts.map +1 -0
- package/node_modules/@azure/msal-common/dist/utils/TimeUtils.js +50 -0
- package/node_modules/@azure/msal-common/dist/utils/TimeUtils.js.map +1 -0
- package/node_modules/@azure/msal-common/package.json +79 -0
- package/package.json +99 -95
- package/dist/_virtual/_tslib.js +0 -117
- package/dist/_virtual/_tslib.js.map +0 -1
- package/dist/app/ClientApplication.d.ts.map +0 -1
- package/dist/app/ClientApplication.js +0 -1053
- package/dist/app/ClientApplication.js.map +0 -1
- package/dist/index.cjs.js +0 -18045
- package/dist/index.cjs.js.map +0 -1
- package/lib/msal-browser.js +0 -18051
- package/lib/msal-browser.js.map +0 -1
- package/lib/msal-browser.min.js +0 -70
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/*! @azure/msal-browser
|
|
1
|
+
/*! @azure/msal-browser v3.0.0-alpha.0 2023-05-03 */
|
|
2
2
|
'use strict';
|
|
3
|
-
import {
|
|
4
|
-
import { ScopeSet, AuthToken, Constants, AccountEntity, AuthorityType, IdTokenEntity, AccessTokenEntity, PerformanceEvents, TimeUtils, ClientAuthError, AuthenticationScheme, PopTokenGenerator, UrlString, OIDC_DEFAULT_SCOPES, PromptValue } from '@azure/msal-common';
|
|
3
|
+
import { PerformanceEvents, TimeUtils, ScopeSet, ClientAuthError, AuthToken, Constants, AccountEntity, AuthorityType, AuthenticationScheme, PopTokenGenerator, IdTokenEntity, AccessTokenEntity, UrlString, OIDC_DEFAULT_SCOPES, PromptValue } from '@azure/msal-common';
|
|
5
4
|
import { BaseInteractionClient } from './BaseInteractionClient.js';
|
|
6
|
-
import { TemporaryCacheKeys,
|
|
5
|
+
import { TemporaryCacheKeys, NativeConstants, NativeExtensionMethod, ApiId } from '../utils/BrowserConstants.js';
|
|
7
6
|
import { NativeAuthError } from '../error/NativeAuthError.js';
|
|
8
7
|
import { BrowserAuthError } from '../error/BrowserAuthError.js';
|
|
9
8
|
import { SilentCacheClient } from './SilentCacheClient.js';
|
|
@@ -12,88 +11,73 @@ import { SilentCacheClient } from './SilentCacheClient.js';
|
|
|
12
11
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
13
12
|
* Licensed under the MIT License.
|
|
14
13
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
_this.silentCacheClient = new SilentCacheClient(config, _this.nativeStorageManager, browserCrypto, logger, eventHandler, navigationClient, performanceClient, provider, correlationId);
|
|
24
|
-
return _this;
|
|
14
|
+
class NativeInteractionClient extends BaseInteractionClient {
|
|
15
|
+
constructor(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, provider, accountId, nativeStorageImpl, correlationId) {
|
|
16
|
+
super(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, performanceClient, provider, correlationId);
|
|
17
|
+
this.apiId = apiId;
|
|
18
|
+
this.accountId = accountId;
|
|
19
|
+
this.nativeMessageHandler = provider;
|
|
20
|
+
this.nativeStorageManager = nativeStorageImpl;
|
|
21
|
+
this.silentCacheClient = new SilentCacheClient(config, this.nativeStorageManager, browserCrypto, logger, eventHandler, navigationClient, performanceClient, provider, correlationId);
|
|
25
22
|
}
|
|
26
23
|
/**
|
|
27
24
|
* Acquire token from native platform via browser extension
|
|
28
25
|
* @param request
|
|
29
26
|
*/
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
_a.trys.push([2, 4, , 5]);
|
|
45
|
-
return [4 /*yield*/, this.acquireTokensFromCache(this.accountId, nativeRequest)];
|
|
46
|
-
case 3:
|
|
47
|
-
result = _a.sent();
|
|
48
|
-
nativeATMeasurement.endMeasurement({
|
|
49
|
-
success: true,
|
|
50
|
-
isNativeBroker: false,
|
|
51
|
-
fromCache: true
|
|
52
|
-
});
|
|
53
|
-
return [2 /*return*/, result];
|
|
54
|
-
case 4:
|
|
55
|
-
_a.sent();
|
|
56
|
-
// continue with a native call for any and all errors
|
|
57
|
-
this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call");
|
|
58
|
-
return [3 /*break*/, 5];
|
|
59
|
-
case 5:
|
|
60
|
-
messageBody = {
|
|
61
|
-
method: NativeExtensionMethod.GetToken,
|
|
62
|
-
request: nativeRequest
|
|
63
|
-
};
|
|
64
|
-
return [4 /*yield*/, this.nativeMessageHandler.sendMessage(messageBody)];
|
|
65
|
-
case 6:
|
|
66
|
-
response = _a.sent();
|
|
67
|
-
validatedResponse = this.validateNativeResponse(response);
|
|
68
|
-
return [2 /*return*/, this.handleNativeResponse(validatedResponse, nativeRequest, reqTimestamp)
|
|
69
|
-
.then(function (result) {
|
|
70
|
-
nativeATMeasurement.endMeasurement({
|
|
71
|
-
success: true,
|
|
72
|
-
isNativeBroker: true,
|
|
73
|
-
requestId: result.requestId
|
|
74
|
-
});
|
|
75
|
-
return result;
|
|
76
|
-
})
|
|
77
|
-
.catch(function (error) {
|
|
78
|
-
nativeATMeasurement.endMeasurement({
|
|
79
|
-
success: false,
|
|
80
|
-
errorCode: error.errorCode,
|
|
81
|
-
subErrorCode: error.subError,
|
|
82
|
-
isNativeBroker: true
|
|
83
|
-
});
|
|
84
|
-
throw error;
|
|
85
|
-
})];
|
|
86
|
-
}
|
|
27
|
+
async acquireToken(request) {
|
|
28
|
+
this.logger.trace("NativeInteractionClient - acquireToken called.");
|
|
29
|
+
// start the perf measurement
|
|
30
|
+
const nativeATMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.NativeInteractionClientAcquireToken, request.correlationId);
|
|
31
|
+
const reqTimestamp = TimeUtils.nowSeconds();
|
|
32
|
+
// initialize native request
|
|
33
|
+
const nativeRequest = await this.initializeNativeRequest(request);
|
|
34
|
+
// check if the tokens can be retrieved from internal cache
|
|
35
|
+
try {
|
|
36
|
+
const result = await this.acquireTokensFromCache(this.accountId, nativeRequest);
|
|
37
|
+
nativeATMeasurement.endMeasurement({
|
|
38
|
+
success: true,
|
|
39
|
+
isNativeBroker: false,
|
|
40
|
+
fromCache: true,
|
|
87
41
|
});
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
catch (e) {
|
|
45
|
+
// continue with a native call for any and all errors
|
|
46
|
+
this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call");
|
|
47
|
+
}
|
|
48
|
+
// fall back to native calls
|
|
49
|
+
const messageBody = {
|
|
50
|
+
method: NativeExtensionMethod.GetToken,
|
|
51
|
+
request: nativeRequest,
|
|
52
|
+
};
|
|
53
|
+
const response = await this.nativeMessageHandler.sendMessage(messageBody);
|
|
54
|
+
const validatedResponse = this.validateNativeResponse(response);
|
|
55
|
+
return this.handleNativeResponse(validatedResponse, nativeRequest, reqTimestamp)
|
|
56
|
+
.then((result) => {
|
|
57
|
+
nativeATMeasurement.endMeasurement({
|
|
58
|
+
success: true,
|
|
59
|
+
isNativeBroker: true,
|
|
60
|
+
requestId: result.requestId,
|
|
61
|
+
});
|
|
62
|
+
return result;
|
|
63
|
+
})
|
|
64
|
+
.catch((error) => {
|
|
65
|
+
nativeATMeasurement.endMeasurement({
|
|
66
|
+
success: false,
|
|
67
|
+
errorCode: error.errorCode,
|
|
68
|
+
subErrorCode: error.subError,
|
|
69
|
+
isNativeBroker: true,
|
|
70
|
+
});
|
|
71
|
+
throw error;
|
|
88
72
|
});
|
|
89
|
-
}
|
|
73
|
+
}
|
|
90
74
|
/**
|
|
91
75
|
* Creates silent flow request
|
|
92
76
|
* @param request
|
|
93
77
|
* @param cachedAccount
|
|
94
78
|
* @returns CommonSilentFlowRequest
|
|
95
79
|
*/
|
|
96
|
-
|
|
80
|
+
createSilentCacheRequest(request, cachedAccount) {
|
|
97
81
|
return {
|
|
98
82
|
authority: request.authority,
|
|
99
83
|
correlationId: this.correlationId,
|
|
@@ -101,203 +85,158 @@ var NativeInteractionClient = /** @class */ (function (_super) {
|
|
|
101
85
|
account: cachedAccount,
|
|
102
86
|
forceRefresh: false,
|
|
103
87
|
};
|
|
104
|
-
}
|
|
88
|
+
}
|
|
105
89
|
/**
|
|
106
90
|
* Fetches the tokens from the cache if un-expired
|
|
107
91
|
* @param nativeAccountId
|
|
108
92
|
* @param request
|
|
109
93
|
* @returns authenticationResult
|
|
110
94
|
*/
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
throw ClientAuthError.createNoAccountFoundError();
|
|
120
|
-
}
|
|
121
|
-
account = this.browserStorage.getAccountInfoFilteredBy({ nativeAccountId: nativeAccountId });
|
|
122
|
-
if (!account) {
|
|
123
|
-
throw ClientAuthError.createNoAccountFoundError();
|
|
124
|
-
}
|
|
125
|
-
_a.label = 1;
|
|
126
|
-
case 1:
|
|
127
|
-
_a.trys.push([1, 3, , 4]);
|
|
128
|
-
silentRequest = this.createSilentCacheRequest(request, account);
|
|
129
|
-
return [4 /*yield*/, this.silentCacheClient.acquireToken(silentRequest)];
|
|
130
|
-
case 2:
|
|
131
|
-
result = _a.sent();
|
|
132
|
-
return [2 /*return*/, result];
|
|
133
|
-
case 3:
|
|
134
|
-
e_2 = _a.sent();
|
|
135
|
-
throw e_2;
|
|
136
|
-
case 4: return [2 /*return*/];
|
|
137
|
-
}
|
|
138
|
-
});
|
|
95
|
+
async acquireTokensFromCache(nativeAccountId, request) {
|
|
96
|
+
if (!nativeAccountId) {
|
|
97
|
+
this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided");
|
|
98
|
+
throw ClientAuthError.createNoAccountFoundError();
|
|
99
|
+
}
|
|
100
|
+
// fetch the account from in-memory cache
|
|
101
|
+
const account = this.browserStorage.getAccountInfoFilteredBy({
|
|
102
|
+
nativeAccountId,
|
|
139
103
|
});
|
|
140
|
-
|
|
104
|
+
if (!account) {
|
|
105
|
+
throw ClientAuthError.createNoAccountFoundError();
|
|
106
|
+
}
|
|
107
|
+
// leverage silent flow for cached tokens retrieval
|
|
108
|
+
try {
|
|
109
|
+
const silentRequest = this.createSilentCacheRequest(request, account);
|
|
110
|
+
const result = await this.silentCacheClient.acquireToken(silentRequest);
|
|
111
|
+
return result;
|
|
112
|
+
}
|
|
113
|
+
catch (e) {
|
|
114
|
+
throw e;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
141
117
|
/**
|
|
142
118
|
* Acquires a token from native platform then redirects to the redirectUri instead of returning the response
|
|
143
119
|
* @param request
|
|
144
120
|
*/
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
return [3 /*break*/, 5];
|
|
174
|
-
case 5:
|
|
175
|
-
this.browserStorage.setTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, JSON.stringify(nativeRequest), true);
|
|
176
|
-
navigationOptions = {
|
|
177
|
-
apiId: ApiId.acquireTokenRedirect,
|
|
178
|
-
timeout: this.config.system.redirectNavigationTimeout,
|
|
179
|
-
noHistory: false
|
|
180
|
-
};
|
|
181
|
-
redirectUri = this.config.auth.navigateToLoginRequestUrl ? window.location.href : this.getRedirectUri(request.redirectUri);
|
|
182
|
-
return [4 /*yield*/, this.navigationClient.navigateExternal(redirectUri, navigationOptions)];
|
|
183
|
-
case 6:
|
|
184
|
-
_a.sent(); // Need to treat this as external to ensure handleRedirectPromise is run again
|
|
185
|
-
return [2 /*return*/];
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
});
|
|
189
|
-
};
|
|
121
|
+
async acquireTokenRedirect(request) {
|
|
122
|
+
this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");
|
|
123
|
+
const nativeRequest = await this.initializeNativeRequest(request);
|
|
124
|
+
const messageBody = {
|
|
125
|
+
method: NativeExtensionMethod.GetToken,
|
|
126
|
+
request: nativeRequest,
|
|
127
|
+
};
|
|
128
|
+
try {
|
|
129
|
+
const response = await this.nativeMessageHandler.sendMessage(messageBody);
|
|
130
|
+
this.validateNativeResponse(response);
|
|
131
|
+
}
|
|
132
|
+
catch (e) {
|
|
133
|
+
// Only throw fatal errors here to allow application to fallback to regular redirect. Otherwise proceed and the error will be thrown in handleRedirectPromise
|
|
134
|
+
if (e instanceof NativeAuthError && e.isFatal()) {
|
|
135
|
+
throw e;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
this.browserStorage.setTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, JSON.stringify(nativeRequest), true);
|
|
139
|
+
const navigationOptions = {
|
|
140
|
+
apiId: ApiId.acquireTokenRedirect,
|
|
141
|
+
timeout: this.config.system.redirectNavigationTimeout,
|
|
142
|
+
noHistory: false,
|
|
143
|
+
};
|
|
144
|
+
const redirectUri = this.config.auth.navigateToLoginRequestUrl
|
|
145
|
+
? window.location.href
|
|
146
|
+
: this.getRedirectUri(request.redirectUri);
|
|
147
|
+
await this.navigationClient.navigateExternal(redirectUri, navigationOptions); // Need to treat this as external to ensure handleRedirectPromise is run again
|
|
148
|
+
}
|
|
190
149
|
/**
|
|
191
150
|
* If the previous page called native platform for a token using redirect APIs, send the same request again and return the response
|
|
192
151
|
*/
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
this.browserStorage.setInteractionInProgress(false);
|
|
229
|
-
return [2 /*return*/, result];
|
|
230
|
-
case 3:
|
|
231
|
-
e_4 = _a.sent();
|
|
232
|
-
this.browserStorage.setInteractionInProgress(false);
|
|
233
|
-
throw e_4;
|
|
234
|
-
case 4: return [2 /*return*/];
|
|
235
|
-
}
|
|
236
|
-
});
|
|
237
|
-
});
|
|
238
|
-
};
|
|
152
|
+
async handleRedirectPromise() {
|
|
153
|
+
this.logger.trace("NativeInteractionClient - handleRedirectPromise called.");
|
|
154
|
+
if (!this.browserStorage.isInteractionInProgress(true)) {
|
|
155
|
+
this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null.");
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
// remove prompt from the request to prevent WAM from prompting twice
|
|
159
|
+
const cachedRequest = this.browserStorage.getCachedNativeRequest();
|
|
160
|
+
if (!cachedRequest) {
|
|
161
|
+
this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null.");
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
const { prompt, ...request } = cachedRequest;
|
|
165
|
+
if (prompt) {
|
|
166
|
+
this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window.");
|
|
167
|
+
}
|
|
168
|
+
this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.NATIVE_REQUEST));
|
|
169
|
+
const messageBody = {
|
|
170
|
+
method: NativeExtensionMethod.GetToken,
|
|
171
|
+
request: request,
|
|
172
|
+
};
|
|
173
|
+
const reqTimestamp = TimeUtils.nowSeconds();
|
|
174
|
+
try {
|
|
175
|
+
this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");
|
|
176
|
+
const response = await this.nativeMessageHandler.sendMessage(messageBody);
|
|
177
|
+
this.validateNativeResponse(response);
|
|
178
|
+
const result = this.handleNativeResponse(response, request, reqTimestamp);
|
|
179
|
+
this.browserStorage.setInteractionInProgress(false);
|
|
180
|
+
return result;
|
|
181
|
+
}
|
|
182
|
+
catch (e) {
|
|
183
|
+
this.browserStorage.setInteractionInProgress(false);
|
|
184
|
+
throw e;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
239
187
|
/**
|
|
240
188
|
* Logout from native platform via browser extension
|
|
241
189
|
* @param request
|
|
242
190
|
*/
|
|
243
|
-
|
|
191
|
+
logout() {
|
|
244
192
|
this.logger.trace("NativeInteractionClient - logout called.");
|
|
245
193
|
return Promise.reject("Logout not implemented yet");
|
|
246
|
-
}
|
|
194
|
+
}
|
|
247
195
|
/**
|
|
248
196
|
* Transform response from native platform into AuthenticationResult object which will be returned to the end user
|
|
249
197
|
* @param response
|
|
250
198
|
* @param request
|
|
251
199
|
* @param reqTimestamp
|
|
252
200
|
*/
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
result = _a.sent();
|
|
274
|
-
// cache accounts and tokens in the appropriate storage
|
|
275
|
-
this.cacheAccount(accountEntity);
|
|
276
|
-
this.cacheNativeTokens(response, request, homeAccountIdentifier, idTokenObj, result.accessToken, result.tenantId, reqTimestamp);
|
|
277
|
-
return [2 /*return*/, result];
|
|
278
|
-
}
|
|
279
|
-
});
|
|
280
|
-
});
|
|
281
|
-
};
|
|
201
|
+
async handleNativeResponse(response, request, reqTimestamp) {
|
|
202
|
+
this.logger.trace("NativeInteractionClient - handleNativeResponse called.");
|
|
203
|
+
if (response.account.id !== request.accountId) {
|
|
204
|
+
// User switch in native broker prompt is not supported. All users must first sign in through web flow to ensure server state is in sync
|
|
205
|
+
throw NativeAuthError.createUserSwitchError();
|
|
206
|
+
}
|
|
207
|
+
// Get the preferred_cache domain for the given authority
|
|
208
|
+
const authority = await this.getDiscoveredAuthority(request.authority);
|
|
209
|
+
const authorityPreferredCache = authority.getPreferredCache();
|
|
210
|
+
// generate identifiers
|
|
211
|
+
const idTokenObj = this.createIdTokenObj(response);
|
|
212
|
+
const homeAccountIdentifier = this.createHomeAccountIdentifier(response, idTokenObj);
|
|
213
|
+
const accountEntity = this.createAccountEntity(response, homeAccountIdentifier, idTokenObj, authorityPreferredCache);
|
|
214
|
+
// generate authenticationResult
|
|
215
|
+
const result = await this.generateAuthenticationResult(response, request, idTokenObj, accountEntity, authority.canonicalAuthority, reqTimestamp);
|
|
216
|
+
// cache accounts and tokens in the appropriate storage
|
|
217
|
+
this.cacheAccount(accountEntity);
|
|
218
|
+
this.cacheNativeTokens(response, request, homeAccountIdentifier, idTokenObj, result.accessToken, result.tenantId, reqTimestamp);
|
|
219
|
+
return result;
|
|
220
|
+
}
|
|
282
221
|
/**
|
|
283
222
|
* Create an idToken Object (not entity)
|
|
284
223
|
* @param response
|
|
285
224
|
* @returns
|
|
286
225
|
*/
|
|
287
|
-
|
|
226
|
+
createIdTokenObj(response) {
|
|
288
227
|
return new AuthToken(response.id_token || Constants.EMPTY_STRING, this.browserCrypto);
|
|
289
|
-
}
|
|
228
|
+
}
|
|
290
229
|
/**
|
|
291
230
|
* creates an homeAccountIdentifier for the account
|
|
292
231
|
* @param response
|
|
293
232
|
* @param idTokenObj
|
|
294
233
|
* @returns
|
|
295
234
|
*/
|
|
296
|
-
|
|
235
|
+
createHomeAccountIdentifier(response, idTokenObj) {
|
|
297
236
|
// Save account in browser storage
|
|
298
|
-
|
|
237
|
+
const homeAccountIdentifier = AccountEntity.generateHomeAccountId(response.client_info || Constants.EMPTY_STRING, AuthorityType.Default, this.logger, this.browserCrypto, idTokenObj);
|
|
299
238
|
return homeAccountIdentifier;
|
|
300
|
-
}
|
|
239
|
+
}
|
|
301
240
|
/**
|
|
302
241
|
* Creates account entity
|
|
303
242
|
* @param response
|
|
@@ -306,60 +245,57 @@ var NativeInteractionClient = /** @class */ (function (_super) {
|
|
|
306
245
|
* @param authority
|
|
307
246
|
* @returns
|
|
308
247
|
*/
|
|
309
|
-
|
|
248
|
+
createAccountEntity(response, homeAccountIdentifier, idTokenObj, authority) {
|
|
310
249
|
return AccountEntity.createAccount(response.client_info, homeAccountIdentifier, idTokenObj, undefined, undefined, undefined, authority, response.account.id);
|
|
311
|
-
}
|
|
250
|
+
}
|
|
312
251
|
/**
|
|
313
252
|
* Helper to generate scopes
|
|
314
253
|
* @param response
|
|
315
254
|
* @param request
|
|
316
255
|
* @returns
|
|
317
256
|
*/
|
|
318
|
-
|
|
319
|
-
return response.scope
|
|
320
|
-
|
|
257
|
+
generateScopes(response, request) {
|
|
258
|
+
return response.scope
|
|
259
|
+
? ScopeSet.fromString(response.scope)
|
|
260
|
+
: ScopeSet.fromString(request.scope);
|
|
261
|
+
}
|
|
321
262
|
/**
|
|
322
263
|
* If PoP token is requesred, records the PoP token if returned from the WAM, else generates one in the browser
|
|
323
264
|
* @param request
|
|
324
265
|
* @param response
|
|
325
266
|
*/
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
case 2: return [2 /*return*/, response.access_token];
|
|
359
|
-
}
|
|
360
|
-
});
|
|
361
|
-
});
|
|
362
|
-
};
|
|
267
|
+
async generatePopAccessToken(response, request) {
|
|
268
|
+
if (request.tokenType === AuthenticationScheme.POP) {
|
|
269
|
+
/**
|
|
270
|
+
* This code prioritizes SHR returned from the native layer. In case of error/SHR not calculated from WAM and the AT
|
|
271
|
+
* is still received, SHR is calculated locally
|
|
272
|
+
*/
|
|
273
|
+
// Check if native layer returned an SHR token
|
|
274
|
+
if (response.shr) {
|
|
275
|
+
this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer");
|
|
276
|
+
return response.shr;
|
|
277
|
+
}
|
|
278
|
+
// Generate SHR in msal js if WAM does not compute it when POP is enabled
|
|
279
|
+
const popTokenGenerator = new PopTokenGenerator(this.browserCrypto);
|
|
280
|
+
const shrParameters = {
|
|
281
|
+
resourceRequestMethod: request.resourceRequestMethod,
|
|
282
|
+
resourceRequestUri: request.resourceRequestUri,
|
|
283
|
+
shrClaims: request.shrClaims,
|
|
284
|
+
shrNonce: request.shrNonce,
|
|
285
|
+
};
|
|
286
|
+
/**
|
|
287
|
+
* KeyID must be present in the native request from when the PoP key was generated in order for
|
|
288
|
+
* PopTokenGenerator to query the full key for signing
|
|
289
|
+
*/
|
|
290
|
+
if (!request.keyId) {
|
|
291
|
+
throw ClientAuthError.createKeyIdMissingError();
|
|
292
|
+
}
|
|
293
|
+
return await popTokenGenerator.signPopToken(response.access_token, request.keyId, shrParameters);
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
return response.access_token;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
363
299
|
/**
|
|
364
300
|
* Generates authentication result
|
|
365
301
|
* @param response
|
|
@@ -370,55 +306,56 @@ var NativeInteractionClient = /** @class */ (function (_super) {
|
|
|
370
306
|
* @param reqTimestamp
|
|
371
307
|
* @returns
|
|
372
308
|
*/
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
309
|
+
async generateAuthenticationResult(response, request, idTokenObj, accountEntity, authority, reqTimestamp) {
|
|
310
|
+
// Add Native Broker fields to Telemetry
|
|
311
|
+
const mats = this.addTelemetryFromNativeResponse(response);
|
|
312
|
+
// If scopes not returned in server response, use request scopes
|
|
313
|
+
const responseScopes = response.scope
|
|
314
|
+
? ScopeSet.fromString(response.scope)
|
|
315
|
+
: ScopeSet.fromString(request.scope);
|
|
316
|
+
const accountProperties = response.account.properties || {};
|
|
317
|
+
const uid = accountProperties["UID"] ||
|
|
318
|
+
idTokenObj.claims.oid ||
|
|
319
|
+
idTokenObj.claims.sub ||
|
|
320
|
+
Constants.EMPTY_STRING;
|
|
321
|
+
const tid = accountProperties["TenantId"] ||
|
|
322
|
+
idTokenObj.claims.tid ||
|
|
323
|
+
Constants.EMPTY_STRING;
|
|
324
|
+
// generate PoP token as needed
|
|
325
|
+
const responseAccessToken = await this.generatePopAccessToken(response, request);
|
|
326
|
+
const tokenType = request.tokenType === AuthenticationScheme.POP
|
|
327
|
+
? AuthenticationScheme.POP
|
|
328
|
+
: AuthenticationScheme.BEARER;
|
|
329
|
+
const result = {
|
|
330
|
+
authority: authority,
|
|
331
|
+
uniqueId: uid,
|
|
332
|
+
tenantId: tid,
|
|
333
|
+
scopes: responseScopes.asArray(),
|
|
334
|
+
account: accountEntity.getAccountInfo(),
|
|
335
|
+
idToken: response.id_token,
|
|
336
|
+
idTokenClaims: idTokenObj.claims,
|
|
337
|
+
accessToken: responseAccessToken,
|
|
338
|
+
fromCache: mats ? this.isResponseFromCache(mats) : false,
|
|
339
|
+
expiresOn: new Date(Number(reqTimestamp + response.expires_in) * 1000),
|
|
340
|
+
tokenType: tokenType,
|
|
341
|
+
correlationId: this.correlationId,
|
|
342
|
+
state: response.state,
|
|
343
|
+
fromNativeBroker: true,
|
|
344
|
+
};
|
|
345
|
+
return result;
|
|
346
|
+
}
|
|
409
347
|
/**
|
|
410
348
|
* cache the account entity in browser storage
|
|
411
349
|
* @param accountEntity
|
|
412
350
|
*/
|
|
413
|
-
|
|
414
|
-
var _this = this;
|
|
351
|
+
cacheAccount(accountEntity) {
|
|
415
352
|
// Store the account info and hence `nativeAccountId` in browser cache
|
|
416
353
|
this.browserStorage.setAccount(accountEntity);
|
|
417
354
|
// Remove any existing cached tokens for this account in browser storage
|
|
418
|
-
this.browserStorage.removeAccountContext(accountEntity).catch(
|
|
419
|
-
|
|
355
|
+
this.browserStorage.removeAccountContext(accountEntity).catch((e) => {
|
|
356
|
+
this.logger.error(`Error occurred while removing account context from browser storage. ${e}`);
|
|
420
357
|
});
|
|
421
|
-
}
|
|
358
|
+
}
|
|
422
359
|
/**
|
|
423
360
|
* Stores the access_token and id_token in inmemory storage
|
|
424
361
|
* @param response
|
|
@@ -429,23 +366,23 @@ var NativeInteractionClient = /** @class */ (function (_super) {
|
|
|
429
366
|
* @param tenantId
|
|
430
367
|
* @param reqTimestamp
|
|
431
368
|
*/
|
|
432
|
-
|
|
369
|
+
cacheNativeTokens(response, request, homeAccountIdentifier, idTokenObj, responseAccessToken, tenantId, reqTimestamp) {
|
|
433
370
|
// cache idToken in inmemory storage
|
|
434
|
-
|
|
371
|
+
const idTokenEntity = IdTokenEntity.createIdTokenEntity(homeAccountIdentifier, request.authority, response.id_token || Constants.EMPTY_STRING, request.clientId, idTokenObj.claims.tid || Constants.EMPTY_STRING);
|
|
435
372
|
this.nativeStorageManager.setIdTokenCredential(idTokenEntity);
|
|
436
373
|
// cache accessToken in inmemory storage
|
|
437
|
-
|
|
374
|
+
const expiresIn = request.tokenType === AuthenticationScheme.POP
|
|
438
375
|
? Constants.SHR_NONCE_VALIDITY
|
|
439
376
|
: (typeof response.expires_in === "string"
|
|
440
377
|
? parseInt(response.expires_in, 10)
|
|
441
378
|
: response.expires_in) || 0;
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
379
|
+
const tokenExpirationSeconds = reqTimestamp + expiresIn;
|
|
380
|
+
const responseScopes = this.generateScopes(response, request);
|
|
381
|
+
const accessTokenEntity = AccessTokenEntity.createAccessTokenEntity(homeAccountIdentifier, request.authority, responseAccessToken, request.clientId, tenantId, responseScopes.printScopes(), tokenExpirationSeconds, 0, this.browserCrypto);
|
|
445
382
|
this.nativeStorageManager.setAccessTokenCredential(accessTokenEntity);
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
|
|
383
|
+
}
|
|
384
|
+
addTelemetryFromNativeResponse(response) {
|
|
385
|
+
const mats = this.getMATSFromResponse(response);
|
|
449
386
|
if (!mats) {
|
|
450
387
|
return null;
|
|
451
388
|
}
|
|
@@ -464,15 +401,15 @@ var NativeInteractionClient = /** @class */ (function (_super) {
|
|
|
464
401
|
matsSilentMessage: mats.silent_message,
|
|
465
402
|
matsSilentStatus: mats.silent_status,
|
|
466
403
|
matsHttpStatus: mats.http_status,
|
|
467
|
-
matsHttpEventCount: mats.http_event_count
|
|
404
|
+
matsHttpEventCount: mats.http_event_count,
|
|
468
405
|
}, this.correlationId);
|
|
469
406
|
return mats;
|
|
470
|
-
}
|
|
407
|
+
}
|
|
471
408
|
/**
|
|
472
409
|
* Validates native platform response before processing
|
|
473
410
|
* @param response
|
|
474
411
|
*/
|
|
475
|
-
|
|
412
|
+
validateNativeResponse(response) {
|
|
476
413
|
if (response.hasOwnProperty("access_token") &&
|
|
477
414
|
response.hasOwnProperty("id_token") &&
|
|
478
415
|
response.hasOwnProperty("client_info") &&
|
|
@@ -484,13 +421,13 @@ var NativeInteractionClient = /** @class */ (function (_super) {
|
|
|
484
421
|
else {
|
|
485
422
|
throw NativeAuthError.createUnexpectedError("Response missing expected properties.");
|
|
486
423
|
}
|
|
487
|
-
}
|
|
424
|
+
}
|
|
488
425
|
/**
|
|
489
426
|
* Gets MATS telemetry from native response
|
|
490
427
|
* @param response
|
|
491
428
|
* @returns
|
|
492
429
|
*/
|
|
493
|
-
|
|
430
|
+
getMATSFromResponse(response) {
|
|
494
431
|
if (response.properties.MATS) {
|
|
495
432
|
try {
|
|
496
433
|
return JSON.parse(response.properties.MATS);
|
|
@@ -500,86 +437,92 @@ var NativeInteractionClient = /** @class */ (function (_super) {
|
|
|
500
437
|
}
|
|
501
438
|
}
|
|
502
439
|
return null;
|
|
503
|
-
}
|
|
440
|
+
}
|
|
504
441
|
/**
|
|
505
442
|
* Returns whether or not response came from native cache
|
|
506
443
|
* @param response
|
|
507
444
|
* @returns
|
|
508
445
|
*/
|
|
509
|
-
|
|
446
|
+
isResponseFromCache(mats) {
|
|
510
447
|
if (typeof mats.is_cached === "undefined") {
|
|
511
448
|
this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false.");
|
|
512
449
|
return false;
|
|
513
450
|
}
|
|
514
451
|
return !!mats.is_cached;
|
|
515
|
-
}
|
|
452
|
+
}
|
|
516
453
|
/**
|
|
517
454
|
* Translates developer provided request object into NativeRequest object
|
|
518
455
|
* @param request
|
|
519
456
|
*/
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
457
|
+
async initializeNativeRequest(request) {
|
|
458
|
+
this.logger.trace("NativeInteractionClient - initializeNativeRequest called");
|
|
459
|
+
const authority = request.authority || this.config.auth.authority;
|
|
460
|
+
const canonicalAuthority = new UrlString(authority);
|
|
461
|
+
canonicalAuthority.validateAsUri();
|
|
462
|
+
// scopes are expected to be received by the native broker as "scope" and will be added to the request below. Other properties that should be dropped from the request to the native broker can be included in the object destructuring here.
|
|
463
|
+
const { scopes, ...remainingProperties } = request;
|
|
464
|
+
const scopeSet = new ScopeSet(scopes || []);
|
|
465
|
+
scopeSet.appendScopes(OIDC_DEFAULT_SCOPES);
|
|
466
|
+
const getPrompt = () => {
|
|
467
|
+
// If request is silent, prompt is always none
|
|
468
|
+
switch (this.apiId) {
|
|
469
|
+
case ApiId.ssoSilent:
|
|
470
|
+
case ApiId.acquireTokenSilent_silentFlow:
|
|
471
|
+
this.logger.trace("initializeNativeRequest: silent request sets prompt to none");
|
|
472
|
+
return PromptValue.NONE;
|
|
473
|
+
}
|
|
474
|
+
// Prompt not provided, request may proceed and native broker decides if it needs to prompt
|
|
475
|
+
if (!request.prompt) {
|
|
476
|
+
this.logger.trace("initializeNativeRequest: prompt was not provided");
|
|
477
|
+
return undefined;
|
|
478
|
+
}
|
|
479
|
+
// If request is interactive, check if prompt provided is allowed to go directly to native broker
|
|
480
|
+
switch (request.prompt) {
|
|
481
|
+
case PromptValue.NONE:
|
|
482
|
+
case PromptValue.CONSENT:
|
|
483
|
+
case PromptValue.LOGIN:
|
|
484
|
+
this.logger.trace("initializeNativeRequest: prompt is compatible with native flow");
|
|
485
|
+
return request.prompt;
|
|
486
|
+
default:
|
|
487
|
+
this.logger.trace(`initializeNativeRequest: prompt = ${request.prompt} is not compatible with native flow`);
|
|
488
|
+
throw BrowserAuthError.createNativePromptParameterNotSupportedError();
|
|
489
|
+
}
|
|
490
|
+
};
|
|
491
|
+
const validatedRequest = {
|
|
492
|
+
...remainingProperties,
|
|
493
|
+
accountId: this.accountId,
|
|
494
|
+
clientId: this.config.auth.clientId,
|
|
495
|
+
authority: canonicalAuthority.urlString,
|
|
496
|
+
scope: scopeSet.printScopes(),
|
|
497
|
+
redirectUri: this.getRedirectUri(request.redirectUri),
|
|
498
|
+
prompt: getPrompt(),
|
|
499
|
+
correlationId: this.correlationId,
|
|
500
|
+
tokenType: request.authenticationScheme,
|
|
501
|
+
windowTitleSubstring: document.title,
|
|
502
|
+
extraParameters: {
|
|
503
|
+
...request.extraQueryParameters,
|
|
504
|
+
...request.tokenQueryParameters,
|
|
505
|
+
telemetry: NativeConstants.MATS_TELEMETRY,
|
|
506
|
+
},
|
|
507
|
+
extendedExpiryToken: false, // Make this configurable?
|
|
508
|
+
};
|
|
509
|
+
if (request.authenticationScheme === AuthenticationScheme.POP) {
|
|
510
|
+
// add POP request type
|
|
511
|
+
const shrParameters = {
|
|
512
|
+
resourceRequestUri: request.resourceRequestUri,
|
|
513
|
+
resourceRequestMethod: request.resourceRequestMethod,
|
|
514
|
+
shrClaims: request.shrClaims,
|
|
515
|
+
shrNonce: request.shrNonce,
|
|
516
|
+
};
|
|
517
|
+
const popTokenGenerator = new PopTokenGenerator(this.browserCrypto);
|
|
518
|
+
const reqCnfData = await popTokenGenerator.generateCnf(shrParameters);
|
|
519
|
+
// to reduce the URL length, it is recommended to send the hash of the req_cnf instead of the whole string
|
|
520
|
+
validatedRequest.reqCnf = reqCnfData.reqCnfHash;
|
|
521
|
+
validatedRequest.keyId = reqCnfData.kid;
|
|
522
|
+
}
|
|
523
|
+
return validatedRequest;
|
|
524
|
+
}
|
|
525
|
+
}
|
|
583
526
|
|
|
584
527
|
export { NativeInteractionClient };
|
|
585
528
|
//# sourceMappingURL=NativeInteractionClient.js.map
|