@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
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
/*! @azure/msal-common v14.0.0 2023-05-03 */
|
|
2
|
+
'use strict';
|
|
3
|
+
import { BaseClient } from './BaseClient.js';
|
|
4
|
+
import { RequestParameterBuilder } from '../request/RequestParameterBuilder.js';
|
|
5
|
+
import { Separators, GrantType, AuthenticationScheme, AADServerParamKeys, PromptValue, HeaderNames } from '../utils/Constants.js';
|
|
6
|
+
import { ResponseHandler } from '../response/ResponseHandler.js';
|
|
7
|
+
import { StringUtils } from '../utils/StringUtils.js';
|
|
8
|
+
import { ClientAuthError } from '../error/ClientAuthError.js';
|
|
9
|
+
import { UrlString } from '../url/UrlString.js';
|
|
10
|
+
import { PopTokenGenerator } from '../crypto/PopTokenGenerator.js';
|
|
11
|
+
import { TimeUtils } from '../utils/TimeUtils.js';
|
|
12
|
+
import { buildClientInfo, buildClientInfoFromHomeAccountId } from '../account/ClientInfo.js';
|
|
13
|
+
import { CcsCredentialType } from '../account/CcsCredential.js';
|
|
14
|
+
import { ClientConfigurationError } from '../error/ClientConfigurationError.js';
|
|
15
|
+
import { RequestValidator } from '../request/RequestValidator.js';
|
|
16
|
+
import { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.js';
|
|
17
|
+
|
|
18
|
+
/*
|
|
19
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
20
|
+
* Licensed under the MIT License.
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Oauth2.0 Authorization Code client
|
|
24
|
+
*/
|
|
25
|
+
class AuthorizationCodeClient extends BaseClient {
|
|
26
|
+
constructor(configuration, performanceClient) {
|
|
27
|
+
super(configuration, performanceClient);
|
|
28
|
+
// Flag to indicate if client is for hybrid spa auth code redemption
|
|
29
|
+
this.includeRedirectUri = true;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Creates the URL of the authorization request letting the user input credentials and consent to the
|
|
33
|
+
* application. The URL target the /authorize endpoint of the authority configured in the
|
|
34
|
+
* application object.
|
|
35
|
+
*
|
|
36
|
+
* Once the user inputs their credentials and consents, the authority will send a response to the redirect URI
|
|
37
|
+
* sent in the request and should contain an authorization code, which can then be used to acquire tokens via
|
|
38
|
+
* acquireToken(AuthorizationCodeRequest)
|
|
39
|
+
* @param request
|
|
40
|
+
*/
|
|
41
|
+
async getAuthCodeUrl(request) {
|
|
42
|
+
this.performanceClient?.addQueueMeasurement(PerformanceEvents.GetAuthCodeUrl, request.correlationId);
|
|
43
|
+
this.performanceClient?.setPreQueueTime(PerformanceEvents.AuthClientCreateQueryString, request.correlationId);
|
|
44
|
+
const queryString = await this.createAuthCodeUrlQueryString(request);
|
|
45
|
+
return UrlString.appendQueryString(this.authority.authorizationEndpoint, queryString);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* API to acquire a token in exchange of 'authorization_code` acquired by the user in the first leg of the
|
|
49
|
+
* authorization_code_grant
|
|
50
|
+
* @param request
|
|
51
|
+
*/
|
|
52
|
+
async acquireToken(request, authCodePayload) {
|
|
53
|
+
if (!request || !request.code) {
|
|
54
|
+
throw ClientAuthError.createTokenRequestCannotBeMadeError();
|
|
55
|
+
}
|
|
56
|
+
this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthClientAcquireToken, request.correlationId);
|
|
57
|
+
const atsMeasurement = this.performanceClient?.startMeasurement(
|
|
58
|
+
// @ts-ignore
|
|
59
|
+
"AuthCodeClientAcquireToken", request.correlationId);
|
|
60
|
+
this.logger.info("in acquireToken call in auth-code client");
|
|
61
|
+
const reqTimestamp = TimeUtils.nowSeconds();
|
|
62
|
+
this.performanceClient?.setPreQueueTime(PerformanceEvents.AuthClientExecuteTokenRequest, request.correlationId);
|
|
63
|
+
const response = await this.executeTokenRequest(this.authority, request);
|
|
64
|
+
// Retrieve requestId from response headers
|
|
65
|
+
const requestId = response.headers?.[HeaderNames.X_MS_REQUEST_ID];
|
|
66
|
+
const httpVerAuthority = response.headers?.[HeaderNames.X_MS_HTTP_VERSION];
|
|
67
|
+
if (httpVerAuthority) {
|
|
68
|
+
atsMeasurement?.addStaticFields({
|
|
69
|
+
httpVerAuthority,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin, this.performanceClient);
|
|
73
|
+
// Validate response. This function throws a server error if an error is returned by the server.
|
|
74
|
+
responseHandler.validateTokenResponse(response.body);
|
|
75
|
+
this.performanceClient?.setPreQueueTime(PerformanceEvents.HandleServerTokenResponse, request.correlationId);
|
|
76
|
+
return responseHandler
|
|
77
|
+
.handleServerTokenResponse(response.body, this.authority, reqTimestamp, request, authCodePayload, undefined, undefined, undefined, requestId)
|
|
78
|
+
.then((result) => {
|
|
79
|
+
atsMeasurement?.endMeasurement({
|
|
80
|
+
success: true,
|
|
81
|
+
});
|
|
82
|
+
return result;
|
|
83
|
+
})
|
|
84
|
+
.catch((error) => {
|
|
85
|
+
this.logger.verbose("Error in fetching token in ACC", request.correlationId);
|
|
86
|
+
atsMeasurement?.endMeasurement({
|
|
87
|
+
errorCode: error.errorCode,
|
|
88
|
+
subErrorCode: error.subError,
|
|
89
|
+
success: false,
|
|
90
|
+
});
|
|
91
|
+
throw error;
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Handles the hash fragment response from public client code request. Returns a code response used by
|
|
96
|
+
* the client to exchange for a token in acquireToken.
|
|
97
|
+
* @param hashFragment
|
|
98
|
+
*/
|
|
99
|
+
handleFragmentResponse(hashFragment, cachedState) {
|
|
100
|
+
// Handle responses.
|
|
101
|
+
const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, null, null);
|
|
102
|
+
// Deserialize hash fragment response parameters.
|
|
103
|
+
const hashUrlString = new UrlString(hashFragment);
|
|
104
|
+
// Deserialize hash fragment response parameters.
|
|
105
|
+
const serverParams = UrlString.getDeserializedHash(hashUrlString.getHash());
|
|
106
|
+
// Get code response
|
|
107
|
+
responseHandler.validateServerAuthorizationCodeResponse(serverParams, cachedState, this.cryptoUtils);
|
|
108
|
+
// throw when there is no auth code in the response
|
|
109
|
+
if (!serverParams.code) {
|
|
110
|
+
throw ClientAuthError.createNoAuthCodeInServerResponseError();
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
...serverParams,
|
|
114
|
+
// Code param is optional in ServerAuthorizationCodeResponse but required in AuthorizationCodePaylod
|
|
115
|
+
code: serverParams.code,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Used to log out the current user, and redirect the user to the postLogoutRedirectUri.
|
|
120
|
+
* Default behaviour is to redirect the user to `window.location.href`.
|
|
121
|
+
* @param authorityUri
|
|
122
|
+
*/
|
|
123
|
+
getLogoutUri(logoutRequest) {
|
|
124
|
+
// Throw error if logoutRequest is null/undefined
|
|
125
|
+
if (!logoutRequest) {
|
|
126
|
+
throw ClientConfigurationError.createEmptyLogoutRequestError();
|
|
127
|
+
}
|
|
128
|
+
const queryString = this.createLogoutUrlQueryString(logoutRequest);
|
|
129
|
+
// Construct logout URI
|
|
130
|
+
return UrlString.appendQueryString(this.authority.endSessionEndpoint, queryString);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Executes POST request to token endpoint
|
|
134
|
+
* @param authority
|
|
135
|
+
* @param request
|
|
136
|
+
*/
|
|
137
|
+
async executeTokenRequest(authority, request) {
|
|
138
|
+
this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthClientExecuteTokenRequest, request.correlationId);
|
|
139
|
+
this.performanceClient?.setPreQueueTime(PerformanceEvents.AuthClientCreateTokenRequestBody, request.correlationId);
|
|
140
|
+
const queryParametersString = this.createTokenQueryParameters(request);
|
|
141
|
+
const endpoint = UrlString.appendQueryString(authority.tokenEndpoint, queryParametersString);
|
|
142
|
+
const requestBody = await this.createTokenRequestBody(request);
|
|
143
|
+
let ccsCredential = undefined;
|
|
144
|
+
if (request.clientInfo) {
|
|
145
|
+
try {
|
|
146
|
+
const clientInfo = buildClientInfo(request.clientInfo, this.cryptoUtils);
|
|
147
|
+
ccsCredential = {
|
|
148
|
+
credential: `${clientInfo.uid}${Separators.CLIENT_INFO_SEPARATOR}${clientInfo.utid}`,
|
|
149
|
+
type: CcsCredentialType.HOME_ACCOUNT_ID,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
catch (e) {
|
|
153
|
+
this.logger.verbose("Could not parse client info for CCS Header: " + e);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
const headers = this.createTokenRequestHeaders(ccsCredential || request.ccsCredential);
|
|
157
|
+
const thumbprint = {
|
|
158
|
+
clientId: this.config.authOptions.clientId,
|
|
159
|
+
authority: authority.canonicalAuthority,
|
|
160
|
+
scopes: request.scopes,
|
|
161
|
+
claims: request.claims,
|
|
162
|
+
authenticationScheme: request.authenticationScheme,
|
|
163
|
+
resourceRequestMethod: request.resourceRequestMethod,
|
|
164
|
+
resourceRequestUri: request.resourceRequestUri,
|
|
165
|
+
shrClaims: request.shrClaims,
|
|
166
|
+
sshKid: request.sshKid,
|
|
167
|
+
};
|
|
168
|
+
return this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Generates a map for all the params to be sent to the service
|
|
172
|
+
* @param request
|
|
173
|
+
*/
|
|
174
|
+
async createTokenRequestBody(request) {
|
|
175
|
+
this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthClientCreateTokenRequestBody, request.correlationId);
|
|
176
|
+
const parameterBuilder = new RequestParameterBuilder();
|
|
177
|
+
parameterBuilder.addClientId(this.config.authOptions.clientId);
|
|
178
|
+
/*
|
|
179
|
+
* For hybrid spa flow, there will be a code but no verifier
|
|
180
|
+
* In this scenario, don't include redirect uri as auth code will not be bound to redirect URI
|
|
181
|
+
*/
|
|
182
|
+
if (!this.includeRedirectUri) {
|
|
183
|
+
// Just validate
|
|
184
|
+
RequestValidator.validateRedirectUri(request.redirectUri);
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
// Validate and include redirect uri
|
|
188
|
+
parameterBuilder.addRedirectUri(request.redirectUri);
|
|
189
|
+
}
|
|
190
|
+
// Add scope array, parameter builder will add default scopes and dedupe
|
|
191
|
+
parameterBuilder.addScopes(request.scopes);
|
|
192
|
+
// add code: user set, not validated
|
|
193
|
+
parameterBuilder.addAuthorizationCode(request.code);
|
|
194
|
+
// Add library metadata
|
|
195
|
+
parameterBuilder.addLibraryInfo(this.config.libraryInfo);
|
|
196
|
+
parameterBuilder.addApplicationTelemetry(this.config.telemetry.application);
|
|
197
|
+
parameterBuilder.addThrottling();
|
|
198
|
+
if (this.serverTelemetryManager) {
|
|
199
|
+
parameterBuilder.addServerTelemetry(this.serverTelemetryManager);
|
|
200
|
+
}
|
|
201
|
+
// add code_verifier if passed
|
|
202
|
+
if (request.codeVerifier) {
|
|
203
|
+
parameterBuilder.addCodeVerifier(request.codeVerifier);
|
|
204
|
+
}
|
|
205
|
+
if (this.config.clientCredentials.clientSecret) {
|
|
206
|
+
parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);
|
|
207
|
+
}
|
|
208
|
+
if (this.config.clientCredentials.clientAssertion) {
|
|
209
|
+
const clientAssertion = this.config.clientCredentials.clientAssertion;
|
|
210
|
+
parameterBuilder.addClientAssertion(clientAssertion.assertion);
|
|
211
|
+
parameterBuilder.addClientAssertionType(clientAssertion.assertionType);
|
|
212
|
+
}
|
|
213
|
+
parameterBuilder.addGrantType(GrantType.AUTHORIZATION_CODE_GRANT);
|
|
214
|
+
parameterBuilder.addClientInfo();
|
|
215
|
+
if (request.authenticationScheme === AuthenticationScheme.POP) {
|
|
216
|
+
const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.performanceClient);
|
|
217
|
+
this.performanceClient?.setPreQueueTime(PerformanceEvents.PopTokenGenerateCnf, request.correlationId);
|
|
218
|
+
const reqCnfData = await popTokenGenerator.generateCnf(request);
|
|
219
|
+
// SPA PoP requires full Base64Url encoded req_cnf string (unhashed)
|
|
220
|
+
parameterBuilder.addPopToken(reqCnfData.reqCnfString);
|
|
221
|
+
}
|
|
222
|
+
else if (request.authenticationScheme === AuthenticationScheme.SSH) {
|
|
223
|
+
if (request.sshJwk) {
|
|
224
|
+
parameterBuilder.addSshJwk(request.sshJwk);
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
throw ClientConfigurationError.createMissingSshJwkError();
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
const correlationId = request.correlationId ||
|
|
231
|
+
this.config.cryptoInterface.createNewGuid();
|
|
232
|
+
parameterBuilder.addCorrelationId(correlationId);
|
|
233
|
+
if (!StringUtils.isEmptyObj(request.claims) ||
|
|
234
|
+
(this.config.authOptions.clientCapabilities &&
|
|
235
|
+
this.config.authOptions.clientCapabilities.length > 0)) {
|
|
236
|
+
parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);
|
|
237
|
+
}
|
|
238
|
+
let ccsCred = undefined;
|
|
239
|
+
if (request.clientInfo) {
|
|
240
|
+
try {
|
|
241
|
+
const clientInfo = buildClientInfo(request.clientInfo, this.cryptoUtils);
|
|
242
|
+
ccsCred = {
|
|
243
|
+
credential: `${clientInfo.uid}${Separators.CLIENT_INFO_SEPARATOR}${clientInfo.utid}`,
|
|
244
|
+
type: CcsCredentialType.HOME_ACCOUNT_ID,
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
catch (e) {
|
|
248
|
+
this.logger.verbose("Could not parse client info for CCS Header: " + e);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
ccsCred = request.ccsCredential;
|
|
253
|
+
}
|
|
254
|
+
// Adds these as parameters in the request instead of headers to prevent CORS preflight request
|
|
255
|
+
if (this.config.systemOptions.preventCorsPreflight && ccsCred) {
|
|
256
|
+
switch (ccsCred.type) {
|
|
257
|
+
case CcsCredentialType.HOME_ACCOUNT_ID:
|
|
258
|
+
try {
|
|
259
|
+
const clientInfo = buildClientInfoFromHomeAccountId(ccsCred.credential);
|
|
260
|
+
parameterBuilder.addCcsOid(clientInfo);
|
|
261
|
+
}
|
|
262
|
+
catch (e) {
|
|
263
|
+
this.logger.verbose("Could not parse home account ID for CCS Header: " +
|
|
264
|
+
e);
|
|
265
|
+
}
|
|
266
|
+
break;
|
|
267
|
+
case CcsCredentialType.UPN:
|
|
268
|
+
parameterBuilder.addCcsUpn(ccsCred.credential);
|
|
269
|
+
break;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
if (request.tokenBodyParameters) {
|
|
273
|
+
parameterBuilder.addExtraQueryParameters(request.tokenBodyParameters);
|
|
274
|
+
}
|
|
275
|
+
// Add hybrid spa parameters if not already provided
|
|
276
|
+
if (request.enableSpaAuthorizationCode &&
|
|
277
|
+
(!request.tokenBodyParameters ||
|
|
278
|
+
!request.tokenBodyParameters[AADServerParamKeys.RETURN_SPA_CODE])) {
|
|
279
|
+
parameterBuilder.addExtraQueryParameters({
|
|
280
|
+
[AADServerParamKeys.RETURN_SPA_CODE]: "1",
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
return parameterBuilder.createQueryString();
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* This API validates the `AuthorizationCodeUrlRequest` and creates a URL
|
|
287
|
+
* @param request
|
|
288
|
+
*/
|
|
289
|
+
async createAuthCodeUrlQueryString(request) {
|
|
290
|
+
this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthClientCreateQueryString, request.correlationId);
|
|
291
|
+
const parameterBuilder = new RequestParameterBuilder();
|
|
292
|
+
parameterBuilder.addClientId(this.config.authOptions.clientId);
|
|
293
|
+
const requestScopes = [
|
|
294
|
+
...(request.scopes || []),
|
|
295
|
+
...(request.extraScopesToConsent || []),
|
|
296
|
+
];
|
|
297
|
+
parameterBuilder.addScopes(requestScopes);
|
|
298
|
+
// validate the redirectUri (to be a non null value)
|
|
299
|
+
parameterBuilder.addRedirectUri(request.redirectUri);
|
|
300
|
+
// generate the correlationId if not set by the user and add
|
|
301
|
+
const correlationId = request.correlationId ||
|
|
302
|
+
this.config.cryptoInterface.createNewGuid();
|
|
303
|
+
parameterBuilder.addCorrelationId(correlationId);
|
|
304
|
+
// add response_mode. If not passed in it defaults to query.
|
|
305
|
+
parameterBuilder.addResponseMode(request.responseMode);
|
|
306
|
+
// add response_type = code
|
|
307
|
+
parameterBuilder.addResponseTypeCode();
|
|
308
|
+
// add library info parameters
|
|
309
|
+
parameterBuilder.addLibraryInfo(this.config.libraryInfo);
|
|
310
|
+
parameterBuilder.addApplicationTelemetry(this.config.telemetry.application);
|
|
311
|
+
// add client_info=1
|
|
312
|
+
parameterBuilder.addClientInfo();
|
|
313
|
+
if (request.codeChallenge && request.codeChallengeMethod) {
|
|
314
|
+
parameterBuilder.addCodeChallengeParams(request.codeChallenge, request.codeChallengeMethod);
|
|
315
|
+
}
|
|
316
|
+
if (request.prompt) {
|
|
317
|
+
parameterBuilder.addPrompt(request.prompt);
|
|
318
|
+
}
|
|
319
|
+
if (request.domainHint) {
|
|
320
|
+
parameterBuilder.addDomainHint(request.domainHint);
|
|
321
|
+
}
|
|
322
|
+
// Add sid or loginHint with preference for login_hint claim (in request) -> sid -> loginHint (upn/email) -> username of AccountInfo object
|
|
323
|
+
if (request.prompt !== PromptValue.SELECT_ACCOUNT) {
|
|
324
|
+
// AAD will throw if prompt=select_account is passed with an account hint
|
|
325
|
+
if (request.sid && request.prompt === PromptValue.NONE) {
|
|
326
|
+
// SessionID is only used in silent calls
|
|
327
|
+
this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request");
|
|
328
|
+
parameterBuilder.addSid(request.sid);
|
|
329
|
+
}
|
|
330
|
+
else if (request.account) {
|
|
331
|
+
const accountSid = this.extractAccountSid(request.account);
|
|
332
|
+
const accountLoginHintClaim = this.extractLoginHint(request.account);
|
|
333
|
+
// If login_hint claim is present, use it over sid/username
|
|
334
|
+
if (accountLoginHintClaim) {
|
|
335
|
+
this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account");
|
|
336
|
+
parameterBuilder.addLoginHint(accountLoginHintClaim);
|
|
337
|
+
try {
|
|
338
|
+
const clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);
|
|
339
|
+
parameterBuilder.addCcsOid(clientInfo);
|
|
340
|
+
}
|
|
341
|
+
catch (e) {
|
|
342
|
+
this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header");
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
else if (accountSid && request.prompt === PromptValue.NONE) {
|
|
346
|
+
/*
|
|
347
|
+
* If account and loginHint are provided, we will check account first for sid before adding loginHint
|
|
348
|
+
* SessionId is only used in silent calls
|
|
349
|
+
*/
|
|
350
|
+
this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account");
|
|
351
|
+
parameterBuilder.addSid(accountSid);
|
|
352
|
+
try {
|
|
353
|
+
const clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);
|
|
354
|
+
parameterBuilder.addCcsOid(clientInfo);
|
|
355
|
+
}
|
|
356
|
+
catch (e) {
|
|
357
|
+
this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header");
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
else if (request.loginHint) {
|
|
361
|
+
this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request");
|
|
362
|
+
parameterBuilder.addLoginHint(request.loginHint);
|
|
363
|
+
parameterBuilder.addCcsUpn(request.loginHint);
|
|
364
|
+
}
|
|
365
|
+
else if (request.account.username) {
|
|
366
|
+
// Fallback to account username if provided
|
|
367
|
+
this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account");
|
|
368
|
+
parameterBuilder.addLoginHint(request.account.username);
|
|
369
|
+
try {
|
|
370
|
+
const clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);
|
|
371
|
+
parameterBuilder.addCcsOid(clientInfo);
|
|
372
|
+
}
|
|
373
|
+
catch (e) {
|
|
374
|
+
this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header");
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
else if (request.loginHint) {
|
|
379
|
+
this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request");
|
|
380
|
+
parameterBuilder.addLoginHint(request.loginHint);
|
|
381
|
+
parameterBuilder.addCcsUpn(request.loginHint);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
else {
|
|
385
|
+
this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");
|
|
386
|
+
}
|
|
387
|
+
if (request.nonce) {
|
|
388
|
+
parameterBuilder.addNonce(request.nonce);
|
|
389
|
+
}
|
|
390
|
+
if (request.state) {
|
|
391
|
+
parameterBuilder.addState(request.state);
|
|
392
|
+
}
|
|
393
|
+
if (!StringUtils.isEmpty(request.claims) ||
|
|
394
|
+
(this.config.authOptions.clientCapabilities &&
|
|
395
|
+
this.config.authOptions.clientCapabilities.length > 0)) {
|
|
396
|
+
parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);
|
|
397
|
+
}
|
|
398
|
+
if (request.extraQueryParameters) {
|
|
399
|
+
parameterBuilder.addExtraQueryParameters(request.extraQueryParameters);
|
|
400
|
+
}
|
|
401
|
+
if (request.nativeBroker) {
|
|
402
|
+
// signal ests that this is a WAM call
|
|
403
|
+
parameterBuilder.addNativeBroker();
|
|
404
|
+
// pass the req_cnf for POP
|
|
405
|
+
if (request.authenticationScheme === AuthenticationScheme.POP) {
|
|
406
|
+
const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils);
|
|
407
|
+
// to reduce the URL length, it is recommended to send the hash of the req_cnf instead of the whole string
|
|
408
|
+
const reqCnfData = await popTokenGenerator.generateCnf(request);
|
|
409
|
+
parameterBuilder.addPopToken(reqCnfData.reqCnfHash);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
return parameterBuilder.createQueryString();
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* This API validates the `EndSessionRequest` and creates a URL
|
|
416
|
+
* @param request
|
|
417
|
+
*/
|
|
418
|
+
createLogoutUrlQueryString(request) {
|
|
419
|
+
const parameterBuilder = new RequestParameterBuilder();
|
|
420
|
+
if (request.postLogoutRedirectUri) {
|
|
421
|
+
parameterBuilder.addPostLogoutRedirectUri(request.postLogoutRedirectUri);
|
|
422
|
+
}
|
|
423
|
+
if (request.correlationId) {
|
|
424
|
+
parameterBuilder.addCorrelationId(request.correlationId);
|
|
425
|
+
}
|
|
426
|
+
if (request.idTokenHint) {
|
|
427
|
+
parameterBuilder.addIdTokenHint(request.idTokenHint);
|
|
428
|
+
}
|
|
429
|
+
if (request.state) {
|
|
430
|
+
parameterBuilder.addState(request.state);
|
|
431
|
+
}
|
|
432
|
+
if (request.logoutHint) {
|
|
433
|
+
parameterBuilder.addLogoutHint(request.logoutHint);
|
|
434
|
+
}
|
|
435
|
+
if (request.extraQueryParameters) {
|
|
436
|
+
parameterBuilder.addExtraQueryParameters(request.extraQueryParameters);
|
|
437
|
+
}
|
|
438
|
+
return parameterBuilder.createQueryString();
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Helper to get sid from account. Returns null if idTokenClaims are not present or sid is not present.
|
|
442
|
+
* @param account
|
|
443
|
+
*/
|
|
444
|
+
extractAccountSid(account) {
|
|
445
|
+
return account.idTokenClaims?.sid || null;
|
|
446
|
+
}
|
|
447
|
+
extractLoginHint(account) {
|
|
448
|
+
return account.idTokenClaims?.login_hint || null;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
export { AuthorizationCodeClient };
|
|
453
|
+
//# sourceMappingURL=AuthorizationCodeClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthorizationCodeClient.js","sources":["../../src/client/AuthorizationCodeClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;;AAGG;AAwCH;;AAEG;AACG,MAAO,uBAAw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AAE;AACpB,YAAA,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AACtD,SAAA;QAED,IAAI,OAAO,CAAC,oBAAoB,EAAE;AAC9B,YAAA,gBAAgB,CAAC,uBAAuB,CACpC,OAAO,CAAC,oBAAoB,CAC/B,CAAC;AACL,SAAA;AAED,QAAA,OAAO,gBAAgB,CAAC,iBAAiB,EAAE,CAAC;KAC/C;AAED;;;AAGG;AACK,IAAA,iBAAiB,CAAC,OAAoB,EAAA;AAC1C,QAAA,OAAO,OAAO,CAAC,aAAa,EAAE,GAAG,IAAI,IAAI,CAAC;KAC7C;AAEO,IAAA,gBAAgB,CAAC,OAAoB,EAAA;AACzC,QAAA,OAAO,OAAO,CAAC,aAAa,EAAE,UAAU,IAAI,IAAI,CAAC;KACpD;AACJ;;;;"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ClientConfiguration, CommonClientConfiguration } from "../config/ClientConfiguration";
|
|
2
|
+
import { INetworkModule } from "../network/INetworkModule";
|
|
3
|
+
import { NetworkManager, NetworkResponse } from "../network/NetworkManager";
|
|
4
|
+
import { ICrypto } from "../crypto/ICrypto";
|
|
5
|
+
import { Authority } from "../authority/Authority";
|
|
6
|
+
import { Logger } from "../logger/Logger";
|
|
7
|
+
import { ServerAuthorizationTokenResponse } from "../response/ServerAuthorizationTokenResponse";
|
|
8
|
+
import { CacheManager } from "../cache/CacheManager";
|
|
9
|
+
import { ServerTelemetryManager } from "../telemetry/server/ServerTelemetryManager";
|
|
10
|
+
import { RequestThumbprint } from "../network/RequestThumbprint";
|
|
11
|
+
import { CcsCredential } from "../account/CcsCredential";
|
|
12
|
+
import { IPerformanceClient } from "../telemetry/performance/IPerformanceClient";
|
|
13
|
+
import { BaseAuthRequest } from "../request/BaseAuthRequest";
|
|
14
|
+
/**
|
|
15
|
+
* Base application class which will construct requests to send to and handle responses from the Microsoft STS using the authorization code flow.
|
|
16
|
+
*/
|
|
17
|
+
export declare abstract class BaseClient {
|
|
18
|
+
logger: Logger;
|
|
19
|
+
protected config: CommonClientConfiguration;
|
|
20
|
+
protected cryptoUtils: ICrypto;
|
|
21
|
+
protected cacheManager: CacheManager;
|
|
22
|
+
protected networkClient: INetworkModule;
|
|
23
|
+
protected serverTelemetryManager: ServerTelemetryManager | null;
|
|
24
|
+
protected networkManager: NetworkManager;
|
|
25
|
+
authority: Authority;
|
|
26
|
+
protected performanceClient?: IPerformanceClient;
|
|
27
|
+
protected constructor(configuration: ClientConfiguration, performanceClient?: IPerformanceClient);
|
|
28
|
+
/**
|
|
29
|
+
* Creates default headers for requests to token endpoint
|
|
30
|
+
*/
|
|
31
|
+
protected createTokenRequestHeaders(ccsCred?: CcsCredential): Record<string, string>;
|
|
32
|
+
/**
|
|
33
|
+
* Http post to token endpoint
|
|
34
|
+
* @param tokenEndpoint
|
|
35
|
+
* @param queryString
|
|
36
|
+
* @param headers
|
|
37
|
+
* @param thumbprint
|
|
38
|
+
*/
|
|
39
|
+
protected executePostToTokenEndpoint(tokenEndpoint: string, queryString: string, headers: Record<string, string>, thumbprint: RequestThumbprint): Promise<NetworkResponse<ServerAuthorizationTokenResponse>>;
|
|
40
|
+
/**
|
|
41
|
+
* Updates the authority object of the client. Endpoint discovery must be completed.
|
|
42
|
+
* @param updatedAuthority
|
|
43
|
+
*/
|
|
44
|
+
updateAuthority(updatedAuthority: Authority): void;
|
|
45
|
+
/**
|
|
46
|
+
* Creates query string for the /token request
|
|
47
|
+
* @param request
|
|
48
|
+
*/
|
|
49
|
+
createTokenQueryParameters(request: BaseAuthRequest): string;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=BaseClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseClient.d.ts","sourceRoot":"","sources":["../../src/client/BaseClient.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,mBAAmB,EAEnB,yBAAyB,EAC5B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE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AAC;IA8BzB;;;;;;OAMG;cACa,0BAA0B,CACtC,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,UAAU,EAAE,iBAAiB,GAC9B,OAAO,CAAC,eAAe,CAAC,gCAAgC,CAAC,CAAC;IAoB7D;;;OAGG;IACH,eAAe,CAAC,gBAAgB,EAAE,SAAS,GAAG,IAAI;IASlD;;;OAGG;IACH,0BAA0B,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM;CAW/D"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/*! @azure/msal-common v14.0.0 2023-05-03 */
|
|
2
|
+
'use strict';
|
|
3
|
+
import { buildClientConfiguration } from '../config/ClientConfiguration.js';
|
|
4
|
+
import { NetworkManager } from '../network/NetworkManager.js';
|
|
5
|
+
import { Logger } from '../logger/Logger.js';
|
|
6
|
+
import { HeaderNames, Constants } from '../utils/Constants.js';
|
|
7
|
+
import { name, version } from '../packageMetadata.js';
|
|
8
|
+
import { ClientAuthError } from '../error/ClientAuthError.js';
|
|
9
|
+
import { CcsCredentialType } from '../account/CcsCredential.js';
|
|
10
|
+
import { buildClientInfoFromHomeAccountId } from '../account/ClientInfo.js';
|
|
11
|
+
import { RequestParameterBuilder } from '../request/RequestParameterBuilder.js';
|
|
12
|
+
|
|
13
|
+
/*
|
|
14
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
15
|
+
* Licensed under the MIT License.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Base application class which will construct requests to send to and handle responses from the Microsoft STS using the authorization code flow.
|
|
19
|
+
*/
|
|
20
|
+
class BaseClient {
|
|
21
|
+
constructor(configuration, performanceClient) {
|
|
22
|
+
// Set the configuration
|
|
23
|
+
this.config = buildClientConfiguration(configuration);
|
|
24
|
+
// Initialize the logger
|
|
25
|
+
this.logger = new Logger(this.config.loggerOptions, name, version);
|
|
26
|
+
// Initialize crypto
|
|
27
|
+
this.cryptoUtils = this.config.cryptoInterface;
|
|
28
|
+
// Initialize storage interface
|
|
29
|
+
this.cacheManager = this.config.storageInterface;
|
|
30
|
+
// Set the network interface
|
|
31
|
+
this.networkClient = this.config.networkInterface;
|
|
32
|
+
// Set the NetworkManager
|
|
33
|
+
this.networkManager = new NetworkManager(this.networkClient, this.cacheManager);
|
|
34
|
+
// Set TelemetryManager
|
|
35
|
+
this.serverTelemetryManager = this.config.serverTelemetryManager;
|
|
36
|
+
// set Authority
|
|
37
|
+
this.authority = this.config.authOptions.authority;
|
|
38
|
+
// set performance telemetry client
|
|
39
|
+
this.performanceClient = performanceClient;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Creates default headers for requests to token endpoint
|
|
43
|
+
*/
|
|
44
|
+
createTokenRequestHeaders(ccsCred) {
|
|
45
|
+
const headers = {};
|
|
46
|
+
headers[HeaderNames.CONTENT_TYPE] = Constants.URL_FORM_CONTENT_TYPE;
|
|
47
|
+
if (!this.config.systemOptions.preventCorsPreflight && ccsCred) {
|
|
48
|
+
switch (ccsCred.type) {
|
|
49
|
+
case CcsCredentialType.HOME_ACCOUNT_ID:
|
|
50
|
+
try {
|
|
51
|
+
const clientInfo = buildClientInfoFromHomeAccountId(ccsCred.credential);
|
|
52
|
+
headers[HeaderNames.CCS_HEADER] = `Oid:${clientInfo.uid}@${clientInfo.utid}`;
|
|
53
|
+
}
|
|
54
|
+
catch (e) {
|
|
55
|
+
this.logger.verbose("Could not parse home account ID for CCS Header: " +
|
|
56
|
+
e);
|
|
57
|
+
}
|
|
58
|
+
break;
|
|
59
|
+
case CcsCredentialType.UPN:
|
|
60
|
+
headers[HeaderNames.CCS_HEADER] = `UPN: ${ccsCred.credential}`;
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return headers;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Http post to token endpoint
|
|
68
|
+
* @param tokenEndpoint
|
|
69
|
+
* @param queryString
|
|
70
|
+
* @param headers
|
|
71
|
+
* @param thumbprint
|
|
72
|
+
*/
|
|
73
|
+
async executePostToTokenEndpoint(tokenEndpoint, queryString, headers, thumbprint) {
|
|
74
|
+
const response = await this.networkManager.sendPostRequest(thumbprint, tokenEndpoint, { body: queryString, headers: headers });
|
|
75
|
+
if (this.config.serverTelemetryManager &&
|
|
76
|
+
response.status < 500 &&
|
|
77
|
+
response.status !== 429) {
|
|
78
|
+
// Telemetry data successfully logged by server, clear Telemetry cache
|
|
79
|
+
this.config.serverTelemetryManager.clearTelemetryCache();
|
|
80
|
+
}
|
|
81
|
+
return response;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Updates the authority object of the client. Endpoint discovery must be completed.
|
|
85
|
+
* @param updatedAuthority
|
|
86
|
+
*/
|
|
87
|
+
updateAuthority(updatedAuthority) {
|
|
88
|
+
if (!updatedAuthority.discoveryComplete()) {
|
|
89
|
+
throw ClientAuthError.createEndpointDiscoveryIncompleteError("Updated authority has not completed endpoint discovery.");
|
|
90
|
+
}
|
|
91
|
+
this.authority = updatedAuthority;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Creates query string for the /token request
|
|
95
|
+
* @param request
|
|
96
|
+
*/
|
|
97
|
+
createTokenQueryParameters(request) {
|
|
98
|
+
const parameterBuilder = new RequestParameterBuilder();
|
|
99
|
+
if (request.tokenQueryParameters) {
|
|
100
|
+
parameterBuilder.addExtraQueryParameters(request.tokenQueryParameters);
|
|
101
|
+
}
|
|
102
|
+
return parameterBuilder.createQueryString();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export { BaseClient };
|
|
107
|
+
//# sourceMappingURL=BaseClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseClient.js","sources":["../../src/client/BaseClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;AAGG;AAy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