@azure/msal-browser 3.0.0-alpha.0 → 3.0.0-alpha.2
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 +45 -45
- package/dist/app/IPublicClientApplication.js +96 -96
- package/dist/app/PublicClientApplication.d.ts +244 -244
- package/dist/app/PublicClientApplication.js +307 -307
- package/dist/broker/nativeBroker/NativeMessageHandler.d.ts +63 -63
- package/dist/broker/nativeBroker/NativeMessageHandler.js +255 -255
- package/dist/broker/nativeBroker/NativeRequest.d.ts +43 -43
- package/dist/broker/nativeBroker/NativeResponse.d.ts +48 -48
- package/dist/cache/AsyncMemoryStorage.d.ts +51 -51
- package/dist/cache/AsyncMemoryStorage.js +132 -132
- package/dist/cache/BrowserCacheManager.d.ts +377 -377
- package/dist/cache/BrowserCacheManager.js +1276 -1276
- package/dist/cache/BrowserStorage.d.ts +11 -11
- package/dist/cache/BrowserStorage.js +35 -35
- package/dist/cache/CryptoKeyStore.d.ts +17 -17
- package/dist/cache/CryptoKeyStore.js +41 -41
- package/dist/cache/DatabaseStorage.d.ts +56 -56
- package/dist/cache/DatabaseStorage.js +190 -190
- package/dist/cache/IAsyncMemoryStorage.d.ts +27 -27
- package/dist/cache/ITokenCache.d.ts +10 -10
- package/dist/cache/IWindowStorage.d.ts +27 -27
- package/dist/cache/MemoryStorage.d.ts +11 -11
- package/dist/cache/MemoryStorage.js +31 -31
- package/dist/cache/TokenCache.d.ts +76 -76
- package/dist/cache/TokenCache.js +225 -225
- package/dist/config/Configuration.d.ts +203 -203
- package/dist/config/Configuration.js +101 -101
- package/dist/controllers/ControllerFactory.d.ts +9 -9
- package/dist/controllers/ControllerFactory.js +37 -37
- package/dist/controllers/IController.d.ts +66 -66
- package/dist/controllers/StandardController.d.ts +413 -413
- package/dist/controllers/StandardController.js +1272 -1272
- package/dist/crypto/BrowserCrypto.d.ts +61 -61
- package/dist/crypto/BrowserCrypto.js +131 -131
- package/dist/crypto/CryptoOps.d.ts +73 -73
- package/dist/crypto/CryptoOps.js +150 -150
- package/dist/crypto/GuidGenerator.d.ts +12 -12
- package/dist/crypto/GuidGenerator.js +96 -96
- package/dist/crypto/ISubtleCrypto.d.ts +9 -9
- package/dist/crypto/ModernBrowserCrypto.d.ts +9 -9
- package/dist/crypto/ModernBrowserCrypto.js +24 -24
- package/dist/crypto/MsBrowserCrypto.d.ts +9 -9
- package/dist/crypto/MsBrowserCrypto.js +79 -79
- package/dist/crypto/MsrBrowserCrypto.d.ts +17 -17
- package/dist/crypto/MsrBrowserCrypto.js +28 -28
- package/dist/crypto/PkceGenerator.d.ts +24 -24
- package/dist/crypto/PkceGenerator.js +58 -58
- package/dist/crypto/SignedHttpRequest.d.ts +30 -30
- package/dist/crypto/SignedHttpRequest.js +39 -39
- package/dist/encode/Base64Decode.d.ts +22 -22
- package/dist/encode/Base64Decode.js +73 -73
- package/dist/encode/Base64Encode.d.ts +31 -31
- package/dist/encode/Base64Encode.js +79 -79
- package/dist/error/BrowserAuthError.d.ts +382 -382
- package/dist/error/BrowserAuthError.js +483 -483
- package/dist/error/BrowserConfigurationAuthError.d.ts +70 -70
- package/dist/error/BrowserConfigurationAuthError.js +96 -96
- package/dist/error/NativeAuthError.d.ts +56 -56
- package/dist/error/NativeAuthError.js +88 -88
- package/dist/event/EventHandler.d.ts +41 -41
- package/dist/event/EventHandler.js +119 -119
- package/dist/event/EventMessage.d.ts +25 -25
- package/dist/event/EventMessage.js +67 -67
- package/dist/event/EventType.d.ts +26 -26
- package/dist/event/EventType.js +31 -31
- package/dist/index.d.ts +35 -35
- package/dist/index.js +1 -1
- package/dist/interaction_client/BaseInteractionClient.d.ts +52 -52
- package/dist/interaction_client/BaseInteractionClient.js +138 -138
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.d.ts +4 -4
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +10 -10
- package/dist/interaction_client/NativeInteractionClient.d.ts +148 -148
- package/dist/interaction_client/NativeInteractionClient.js +516 -516
- package/dist/interaction_client/PopupClient.d.ts +111 -111
- package/dist/interaction_client/PopupClient.js +476 -476
- package/dist/interaction_client/RedirectClient.d.ts +48 -48
- package/dist/interaction_client/RedirectClient.js +290 -290
- package/dist/interaction_client/SilentAuthCodeClient.d.ts +22 -22
- package/dist/interaction_client/SilentAuthCodeClient.js +62 -62
- package/dist/interaction_client/SilentCacheClient.d.ts +21 -21
- package/dist/interaction_client/SilentCacheClient.js +67 -67
- package/dist/interaction_client/SilentIframeClient.d.ts +31 -31
- package/dist/interaction_client/SilentIframeClient.js +127 -127
- package/dist/interaction_client/SilentRefreshClient.d.ts +19 -19
- package/dist/interaction_client/SilentRefreshClient.js +62 -62
- package/dist/interaction_client/StandardInteractionClient.d.ts +59 -59
- package/dist/interaction_client/StandardInteractionClient.js +259 -259
- package/dist/interaction_handler/InteractionHandler.d.ts +39 -39
- package/dist/interaction_handler/InteractionHandler.js +127 -127
- package/dist/interaction_handler/RedirectHandler.d.ts +24 -24
- package/dist/interaction_handler/RedirectHandler.js +118 -118
- package/dist/interaction_handler/SilentHandler.d.ts +47 -47
- package/dist/interaction_handler/SilentHandler.js +162 -162
- package/dist/internals.d.ts +23 -23
- package/dist/internals.js +4 -4
- package/dist/navigation/INavigationClient.d.ts +16 -16
- package/dist/navigation/NavigationClient.d.ts +22 -22
- package/dist/navigation/NavigationClient.js +40 -40
- package/dist/navigation/NavigationOptions.d.ts +12 -12
- package/dist/network/FetchClient.d.ts +26 -26
- package/dist/network/FetchClient.js +99 -99
- package/dist/network/XhrClient.d.ts +40 -40
- package/dist/network/XhrClient.js +117 -117
- package/dist/operatingcontext/BaseOperatingContext.d.ts +40 -40
- package/dist/operatingcontext/BaseOperatingContext.js +44 -44
- package/dist/operatingcontext/StandardOperatingContext.d.ts +25 -25
- package/dist/operatingcontext/StandardOperatingContext.js +43 -43
- package/dist/operatingcontext/TeamsAppOperatingContext.d.ts +25 -25
- package/dist/operatingcontext/TeamsAppOperatingContext.js +42 -42
- package/dist/packageMetadata.d.ts +2 -2
- package/dist/packageMetadata.js +4 -4
- package/dist/request/AuthorizationCodeRequest.d.ts +8 -8
- package/dist/request/AuthorizationUrlRequest.d.ts +8 -8
- package/dist/request/EndSessionPopupRequest.d.ts +18 -18
- package/dist/request/EndSessionRequest.d.ts +15 -15
- package/dist/request/PopupRequest.d.ts +32 -32
- package/dist/request/PopupWindowAttributes.d.ts +15 -15
- package/dist/request/RedirectRequest.d.ts +33 -33
- package/dist/request/SilentRequest.d.ts +30 -30
- package/dist/request/SsoSilentRequest.d.ts +26 -26
- package/dist/telemetry/BrowserPerformanceClient.d.ts +38 -38
- package/dist/telemetry/BrowserPerformanceClient.js +124 -124
- package/dist/telemetry/BrowserPerformanceMeasurement.d.ts +21 -21
- package/dist/telemetry/BrowserPerformanceMeasurement.js +92 -92
- package/dist/utils/BrowserConstants.d.ts +166 -166
- package/dist/utils/BrowserConstants.js +214 -214
- package/dist/utils/BrowserProtocolUtils.d.ts +18 -18
- package/dist/utils/BrowserProtocolUtils.js +34 -34
- package/dist/utils/BrowserStringUtils.d.ts +26 -26
- package/dist/utils/BrowserStringUtils.js +149 -149
- package/dist/utils/BrowserUtils.d.ts +65 -65
- package/dist/utils/BrowserUtils.js +138 -138
- package/dist/utils/MathUtils.d.ts +11 -11
- package/dist/utils/MathUtils.js +21 -21
- package/lib/msal-browser.cjs.js +18383 -0
- package/lib/msal-browser.cjs.js.map +1 -0
- package/lib/msal-browser.js +18389 -0
- package/lib/msal-browser.js.map +1 -0
- package/lib/msal-browser.min.js +74 -0
- package/package.json +97 -98
- package/node_modules/@azure/msal-common/LICENSE +0 -21
- package/node_modules/@azure/msal-common/README.md +0 -62
- package/node_modules/@azure/msal-common/dist/account/AccountInfo.d.ts +0 -32
- package/node_modules/@azure/msal-common/dist/account/AccountInfo.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/account/AuthToken.d.ts +0 -21
- package/node_modules/@azure/msal-common/dist/account/AuthToken.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/account/AuthToken.js +0 -56
- package/node_modules/@azure/msal-common/dist/account/AuthToken.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/account/CcsCredential.d.ts +0 -9
- package/node_modules/@azure/msal-common/dist/account/CcsCredential.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/account/CcsCredential.js +0 -14
- package/node_modules/@azure/msal-common/dist/account/CcsCredential.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/account/ClientCredentials.d.ts +0 -15
- package/node_modules/@azure/msal-common/dist/account/ClientCredentials.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/account/ClientInfo.d.ts +0 -20
- package/node_modules/@azure/msal-common/dist/account/ClientInfo.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/account/ClientInfo.js +0 -46
- package/node_modules/@azure/msal-common/dist/account/ClientInfo.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/account/DecodedAuthToken.d.ts +0 -9
- package/node_modules/@azure/msal-common/dist/account/DecodedAuthToken.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/account/TokenClaims.d.ts +0 -66
- package/node_modules/@azure/msal-common/dist/account/TokenClaims.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/authority/Authority.d.ts +0 -216
- package/node_modules/@azure/msal-common/dist/authority/Authority.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/authority/Authority.js +0 -688
- package/node_modules/@azure/msal-common/dist/authority/Authority.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/authority/AuthorityFactory.d.ts +0 -31
- package/node_modules/@azure/msal-common/dist/authority/AuthorityFactory.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/authority/AuthorityFactory.js +0 -58
- package/node_modules/@azure/msal-common/dist/authority/AuthorityFactory.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/authority/AuthorityMetadata.d.ts +0 -623
- package/node_modules/@azure/msal-common/dist/authority/AuthorityMetadata.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/authority/AuthorityMetadata.js +0 -881
- package/node_modules/@azure/msal-common/dist/authority/AuthorityMetadata.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/authority/AuthorityOptions.d.ts +0 -19
- package/node_modules/@azure/msal-common/dist/authority/AuthorityOptions.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/authority/AuthorityOptions.js +0 -24
- package/node_modules/@azure/msal-common/dist/authority/AuthorityOptions.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/authority/AuthorityType.d.ts +0 -10
- package/node_modules/@azure/msal-common/dist/authority/AuthorityType.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/authority/AuthorityType.js +0 -19
- package/node_modules/@azure/msal-common/dist/authority/AuthorityType.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/authority/AzureRegion.d.ts +0 -2
- package/node_modules/@azure/msal-common/dist/authority/AzureRegion.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/authority/AzureRegionConfiguration.d.ts +0 -6
- package/node_modules/@azure/msal-common/dist/authority/AzureRegionConfiguration.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/authority/CloudDiscoveryMetadata.d.ts +0 -6
- package/node_modules/@azure/msal-common/dist/authority/CloudDiscoveryMetadata.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryErrorResponse.d.ts +0 -14
- package/node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryErrorResponse.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryErrorResponse.js +0 -13
- package/node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryErrorResponse.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryResponse.d.ts +0 -10
- package/node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryResponse.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryResponse.js +0 -13
- package/node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryResponse.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/authority/ImdsOptions.d.ts +0 -6
- package/node_modules/@azure/msal-common/dist/authority/ImdsOptions.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/authority/OpenIdConfigResponse.d.ts +0 -12
- package/node_modules/@azure/msal-common/dist/authority/OpenIdConfigResponse.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/authority/OpenIdConfigResponse.js +0 -15
- package/node_modules/@azure/msal-common/dist/authority/OpenIdConfigResponse.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/authority/ProtocolMode.d.ts +0 -8
- package/node_modules/@azure/msal-common/dist/authority/ProtocolMode.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/authority/ProtocolMode.js +0 -17
- package/node_modules/@azure/msal-common/dist/authority/ProtocolMode.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/authority/RegionDiscovery.d.ts +0 -31
- package/node_modules/@azure/msal-common/dist/authority/RegionDiscovery.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/authority/RegionDiscovery.js +0 -116
- package/node_modules/@azure/msal-common/dist/authority/RegionDiscovery.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/authority/RegionDiscoveryMetadata.d.ts +0 -7
- package/node_modules/@azure/msal-common/dist/authority/RegionDiscoveryMetadata.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts +0 -16
- package/node_modules/@azure/msal-common/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/CacheManager.d.ts +0 -444
- package/node_modules/@azure/msal-common/dist/cache/CacheManager.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/CacheManager.js +0 -1024
- package/node_modules/@azure/msal-common/dist/cache/CacheManager.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/entities/AccessTokenEntity.d.ts +0 -57
- package/node_modules/@azure/msal-common/dist/cache/entities/AccessTokenEntity.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/entities/AccessTokenEntity.js +0 -123
- package/node_modules/@azure/msal-common/dist/cache/entities/AccessTokenEntity.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/entities/AccountEntity.d.ts +0 -100
- package/node_modules/@azure/msal-common/dist/cache/entities/AccountEntity.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/entities/AccountEntity.js +0 -259
- package/node_modules/@azure/msal-common/dist/cache/entities/AccountEntity.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/entities/AppMetadataEntity.d.ts +0 -40
- package/node_modules/@azure/msal-common/dist/cache/entities/AppMetadataEntity.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/entities/AppMetadataEntity.js +0 -73
- package/node_modules/@azure/msal-common/dist/cache/entities/AppMetadataEntity.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/entities/AuthorityMetadataEntity.d.ts +0 -48
- package/node_modules/@azure/msal-common/dist/cache/entities/AuthorityMetadataEntity.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/entities/AuthorityMetadataEntity.js +0 -85
- package/node_modules/@azure/msal-common/dist/cache/entities/AuthorityMetadataEntity.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/entities/CacheRecord.d.ts +0 -14
- package/node_modules/@azure/msal-common/dist/cache/entities/CacheRecord.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/entities/CacheRecord.js +0 -18
- package/node_modules/@azure/msal-common/dist/cache/entities/CacheRecord.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/entities/CredentialEntity.d.ts +0 -89
- package/node_modules/@azure/msal-common/dist/cache/entities/CredentialEntity.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/entities/CredentialEntity.js +0 -144
- package/node_modules/@azure/msal-common/dist/cache/entities/CredentialEntity.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/entities/IdTokenEntity.d.ts +0 -35
- package/node_modules/@azure/msal-common/dist/cache/entities/IdTokenEntity.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/entities/IdTokenEntity.js +0 -64
- package/node_modules/@azure/msal-common/dist/cache/entities/IdTokenEntity.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/entities/RefreshTokenEntity.d.ts +0 -37
- package/node_modules/@azure/msal-common/dist/cache/entities/RefreshTokenEntity.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/entities/RefreshTokenEntity.js +0 -67
- package/node_modules/@azure/msal-common/dist/cache/entities/RefreshTokenEntity.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/entities/ServerTelemetryEntity.d.ts +0 -13
- package/node_modules/@azure/msal-common/dist/cache/entities/ServerTelemetryEntity.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/entities/ServerTelemetryEntity.js +0 -34
- package/node_modules/@azure/msal-common/dist/cache/entities/ServerTelemetryEntity.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/entities/ThrottlingEntity.d.ts +0 -14
- package/node_modules/@azure/msal-common/dist/cache/entities/ThrottlingEntity.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/entities/ThrottlingEntity.js +0 -30
- package/node_modules/@azure/msal-common/dist/cache/entities/ThrottlingEntity.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/interface/ICacheManager.d.ts +0 -166
- package/node_modules/@azure/msal-common/dist/cache/interface/ICacheManager.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/interface/ICachePlugin.d.ts +0 -6
- package/node_modules/@azure/msal-common/dist/cache/interface/ICachePlugin.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/interface/ISerializableTokenCache.d.ts +0 -5
- package/node_modules/@azure/msal-common/dist/cache/interface/ISerializableTokenCache.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/persistence/TokenCacheContext.d.ts +0 -24
- package/node_modules/@azure/msal-common/dist/cache/persistence/TokenCacheContext.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/persistence/TokenCacheContext.js +0 -30
- package/node_modules/@azure/msal-common/dist/cache/persistence/TokenCacheContext.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/cache/utils/CacheTypes.d.ts +0 -63
- package/node_modules/@azure/msal-common/dist/cache/utils/CacheTypes.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/client/AuthorizationCodeClient.d.ts +0 -72
- package/node_modules/@azure/msal-common/dist/client/AuthorizationCodeClient.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/client/AuthorizationCodeClient.js +0 -453
- package/node_modules/@azure/msal-common/dist/client/AuthorizationCodeClient.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/client/BaseClient.d.ts +0 -51
- package/node_modules/@azure/msal-common/dist/client/BaseClient.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/client/BaseClient.js +0 -107
- package/node_modules/@azure/msal-common/dist/client/BaseClient.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/client/RefreshTokenClient.d.ts +0 -35
- package/node_modules/@azure/msal-common/dist/client/RefreshTokenClient.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/client/RefreshTokenClient.js +0 -260
- package/node_modules/@azure/msal-common/dist/client/RefreshTokenClient.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/client/SilentFlowClient.d.ts +0 -25
- package/node_modules/@azure/msal-common/dist/client/SilentFlowClient.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/client/SilentFlowClient.js +0 -108
- package/node_modules/@azure/msal-common/dist/client/SilentFlowClient.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/config/AppTokenProvider.d.ts +0 -39
- package/node_modules/@azure/msal-common/dist/config/AppTokenProvider.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/config/ClientConfiguration.d.ts +0 -134
- package/node_modules/@azure/msal-common/dist/config/ClientConfiguration.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/config/ClientConfiguration.js +0 -101
- package/node_modules/@azure/msal-common/dist/config/ClientConfiguration.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/crypto/ICrypto.d.ts +0 -63
- package/node_modules/@azure/msal-common/dist/crypto/ICrypto.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/crypto/ICrypto.js +0 -49
- package/node_modules/@azure/msal-common/dist/crypto/ICrypto.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/crypto/IGuidGenerator.d.ts +0 -5
- package/node_modules/@azure/msal-common/dist/crypto/IGuidGenerator.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/crypto/JoseHeader.d.ts +0 -22
- package/node_modules/@azure/msal-common/dist/crypto/JoseHeader.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/crypto/JoseHeader.js +0 -44
- package/node_modules/@azure/msal-common/dist/crypto/JoseHeader.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/crypto/PopTokenGenerator.d.ts +0 -58
- package/node_modules/@azure/msal-common/dist/crypto/PopTokenGenerator.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/crypto/PopTokenGenerator.js +0 -92
- package/node_modules/@azure/msal-common/dist/crypto/PopTokenGenerator.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/crypto/SignedHttpRequest.d.ts +0 -12
- package/node_modules/@azure/msal-common/dist/crypto/SignedHttpRequest.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/error/AuthError.d.ts +0 -48
- package/node_modules/@azure/msal-common/dist/error/AuthError.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/error/AuthError.js +0 -58
- package/node_modules/@azure/msal-common/dist/error/AuthError.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/error/ClientAuthError.d.ts +0 -413
- package/node_modules/@azure/msal-common/dist/error/ClientAuthError.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/error/ClientAuthError.js +0 -526
- package/node_modules/@azure/msal-common/dist/error/ClientAuthError.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/error/ClientConfigurationError.d.ts +0 -199
- package/node_modules/@azure/msal-common/dist/error/ClientConfigurationError.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/error/ClientConfigurationError.js +0 -256
- package/node_modules/@azure/msal-common/dist/error/ClientConfigurationError.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/error/InteractionRequiredAuthError.d.ts +0 -60
- package/node_modules/@azure/msal-common/dist/error/InteractionRequiredAuthError.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/error/InteractionRequiredAuthError.js +0 -86
- package/node_modules/@azure/msal-common/dist/error/InteractionRequiredAuthError.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/error/JoseHeaderError.d.ts +0 -29
- package/node_modules/@azure/msal-common/dist/error/JoseHeaderError.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/error/JoseHeaderError.js +0 -46
- package/node_modules/@azure/msal-common/dist/error/JoseHeaderError.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/error/ServerError.d.ts +0 -8
- package/node_modules/@azure/msal-common/dist/error/ServerError.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/error/ServerError.js +0 -21
- package/node_modules/@azure/msal-common/dist/error/ServerError.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/index.cjs.js +0 -8975
- package/node_modules/@azure/msal-common/dist/index.cjs.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/index.d.ts +0 -94
- package/node_modules/@azure/msal-common/dist/index.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/index.js +0 -54
- package/node_modules/@azure/msal-common/dist/index.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/logger/Logger.d.ts +0 -96
- package/node_modules/@azure/msal-common/dist/logger/Logger.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/logger/Logger.js +0 -205
- package/node_modules/@azure/msal-common/dist/logger/Logger.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/network/INetworkModule.d.ts +0 -30
- package/node_modules/@azure/msal-common/dist/network/INetworkModule.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/network/INetworkModule.js +0 -21
- package/node_modules/@azure/msal-common/dist/network/INetworkModule.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/network/NetworkManager.d.ts +0 -33
- package/node_modules/@azure/msal-common/dist/network/NetworkManager.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/network/NetworkManager.js +0 -42
- package/node_modules/@azure/msal-common/dist/network/NetworkManager.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/network/RequestThumbprint.d.ts +0 -17
- package/node_modules/@azure/msal-common/dist/network/RequestThumbprint.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/network/ThrottlingUtils.d.ts +0 -42
- package/node_modules/@azure/msal-common/dist/network/ThrottlingUtils.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/network/ThrottlingUtils.js +0 -102
- package/node_modules/@azure/msal-common/dist/network/ThrottlingUtils.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/packageMetadata.d.ts +0 -3
- package/node_modules/@azure/msal-common/dist/packageMetadata.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/packageMetadata.js +0 -8
- package/node_modules/@azure/msal-common/dist/packageMetadata.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/request/AuthenticationHeaderParser.d.ts +0 -20
- package/node_modules/@azure/msal-common/dist/request/AuthenticationHeaderParser.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/request/AuthenticationHeaderParser.js +0 -63
- package/node_modules/@azure/msal-common/dist/request/AuthenticationHeaderParser.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/request/BaseAuthRequest.d.ts +0 -38
- package/node_modules/@azure/msal-common/dist/request/BaseAuthRequest.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/request/CommonAuthorizationCodeRequest.d.ts +0 -28
- package/node_modules/@azure/msal-common/dist/request/CommonAuthorizationCodeRequest.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/request/CommonAuthorizationUrlRequest.d.ts +0 -51
- package/node_modules/@azure/msal-common/dist/request/CommonAuthorizationUrlRequest.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/request/CommonClientCredentialRequest.d.ts +0 -18
- package/node_modules/@azure/msal-common/dist/request/CommonClientCredentialRequest.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/request/CommonDeviceCodeRequest.d.ts +0 -22
- package/node_modules/@azure/msal-common/dist/request/CommonDeviceCodeRequest.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/request/CommonEndSessionRequest.d.ts +0 -22
- package/node_modules/@azure/msal-common/dist/request/CommonEndSessionRequest.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/request/CommonOnBehalfOfRequest.d.ts +0 -14
- package/node_modules/@azure/msal-common/dist/request/CommonOnBehalfOfRequest.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/request/CommonRefreshTokenRequest.d.ts +0 -20
- package/node_modules/@azure/msal-common/dist/request/CommonRefreshTokenRequest.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/request/CommonSilentFlowRequest.d.ts +0 -19
- package/node_modules/@azure/msal-common/dist/request/CommonSilentFlowRequest.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/request/CommonUsernamePasswordRequest.d.ts +0 -18
- package/node_modules/@azure/msal-common/dist/request/CommonUsernamePasswordRequest.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/request/NativeRequest.d.ts +0 -20
- package/node_modules/@azure/msal-common/dist/request/NativeRequest.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/request/NativeSignOutRequest.d.ts +0 -6
- package/node_modules/@azure/msal-common/dist/request/NativeSignOutRequest.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/request/RequestParameterBuilder.d.ts +0 -217
- package/node_modules/@azure/msal-common/dist/request/RequestParameterBuilder.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/request/RequestParameterBuilder.js +0 -385
- package/node_modules/@azure/msal-common/dist/request/RequestParameterBuilder.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/request/RequestValidator.d.ts +0 -34
- package/node_modules/@azure/msal-common/dist/request/RequestValidator.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/request/RequestValidator.js +0 -92
- package/node_modules/@azure/msal-common/dist/request/RequestValidator.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/request/ScopeSet.d.ts +0 -89
- package/node_modules/@azure/msal-common/dist/request/ScopeSet.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/request/ScopeSet.js +0 -207
- package/node_modules/@azure/msal-common/dist/request/ScopeSet.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/response/AuthenticationResult.d.ts +0 -40
- package/node_modules/@azure/msal-common/dist/response/AuthenticationResult.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/response/AuthorizationCodePayload.d.ts +0 -14
- package/node_modules/@azure/msal-common/dist/response/AuthorizationCodePayload.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/response/DeviceCodeResponse.d.ts +0 -26
- package/node_modules/@azure/msal-common/dist/response/DeviceCodeResponse.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/response/ExternalTokenResponse.d.ts +0 -16
- package/node_modules/@azure/msal-common/dist/response/ExternalTokenResponse.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/response/IMDSBadResponse.d.ts +0 -5
- package/node_modules/@azure/msal-common/dist/response/IMDSBadResponse.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/response/ResponseHandler.d.ts +0 -73
- package/node_modules/@azure/msal-common/dist/response/ResponseHandler.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/response/ResponseHandler.js +0 -325
- package/node_modules/@azure/msal-common/dist/response/ResponseHandler.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/response/ServerAuthorizationCodeResponse.d.ts +0 -26
- package/node_modules/@azure/msal-common/dist/response/ServerAuthorizationCodeResponse.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/response/ServerAuthorizationTokenResponse.d.ts +0 -45
- package/node_modules/@azure/msal-common/dist/response/ServerAuthorizationTokenResponse.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/telemetry/performance/IPerformanceClient.d.ts +0 -43
- package/node_modules/@azure/msal-common/dist/telemetry/performance/IPerformanceClient.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/telemetry/performance/IPerformanceMeasurement.d.ts +0 -6
- package/node_modules/@azure/msal-common/dist/telemetry/performance/IPerformanceMeasurement.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceClient.d.ts +0 -190
- package/node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceClient.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceClient.js +0 -413
- package/node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceClient.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceEvent.d.ts +0 -440
- package/node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceEvent.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceEvent.js +0 -232
- package/node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceEvent.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/telemetry/performance/StubPerformanceClient.d.ts +0 -20
- package/node_modules/@azure/msal-common/dist/telemetry/performance/StubPerformanceClient.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/telemetry/performance/StubPerformanceClient.js +0 -43
- package/node_modules/@azure/msal-common/dist/telemetry/performance/StubPerformanceClient.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/telemetry/server/ServerTelemetryManager.d.ts +0 -66
- package/node_modules/@azure/msal-common/dist/telemetry/server/ServerTelemetryManager.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/telemetry/server/ServerTelemetryManager.js +0 -206
- package/node_modules/@azure/msal-common/dist/telemetry/server/ServerTelemetryManager.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/telemetry/server/ServerTelemetryRequest.d.ts +0 -9
- package/node_modules/@azure/msal-common/dist/telemetry/server/ServerTelemetryRequest.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/url/IUri.d.ts +0 -13
- package/node_modules/@azure/msal-common/dist/url/IUri.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/url/UrlString.d.ts +0 -71
- package/node_modules/@azure/msal-common/dist/url/UrlString.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/url/UrlString.js +0 -252
- package/node_modules/@azure/msal-common/dist/url/UrlString.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/utils/Constants.d.ts +0 -332
- package/node_modules/@azure/msal-common/dist/utils/Constants.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/utils/Constants.js +0 -378
- package/node_modules/@azure/msal-common/dist/utils/Constants.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/utils/MsalTypes.d.ts +0 -7
- package/node_modules/@azure/msal-common/dist/utils/MsalTypes.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/utils/ProtocolUtils.d.ts +0 -43
- package/node_modules/@azure/msal-common/dist/utils/ProtocolUtils.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/utils/ProtocolUtils.js +0 -80
- package/node_modules/@azure/msal-common/dist/utils/ProtocolUtils.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/utils/StringUtils.d.ts +0 -54
- package/node_modules/@azure/msal-common/dist/utils/StringUtils.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/utils/StringUtils.js +0 -131
- package/node_modules/@azure/msal-common/dist/utils/StringUtils.js.map +0 -1
- package/node_modules/@azure/msal-common/dist/utils/TimeUtils.d.ts +0 -28
- package/node_modules/@azure/msal-common/dist/utils/TimeUtils.d.ts.map +0 -1
- package/node_modules/@azure/msal-common/dist/utils/TimeUtils.js +0 -50
- package/node_modules/@azure/msal-common/dist/utils/TimeUtils.js.map +0 -1
- package/node_modules/@azure/msal-common/package.json +0 -79
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ClientConfiguration } from "../config/ClientConfiguration";
|
|
2
|
-
import { BaseClient } from "./BaseClient";
|
|
3
|
-
import { CommonRefreshTokenRequest } from "../request/CommonRefreshTokenRequest";
|
|
4
|
-
import { AuthenticationResult } from "../response/AuthenticationResult";
|
|
5
|
-
import { CommonSilentFlowRequest } from "../request/CommonSilentFlowRequest";
|
|
6
|
-
import { IPerformanceClient } from "../telemetry/performance/IPerformanceClient";
|
|
7
|
-
/**
|
|
8
|
-
* OAuth2.0 refresh token client
|
|
9
|
-
*/
|
|
10
|
-
export declare class RefreshTokenClient extends BaseClient {
|
|
11
|
-
constructor(configuration: ClientConfiguration, performanceClient?: IPerformanceClient);
|
|
12
|
-
acquireToken(request: CommonRefreshTokenRequest): Promise<AuthenticationResult>;
|
|
13
|
-
/**
|
|
14
|
-
* Gets cached refresh token and attaches to request, then calls acquireToken API
|
|
15
|
-
* @param request
|
|
16
|
-
*/
|
|
17
|
-
acquireTokenByRefreshToken(request: CommonSilentFlowRequest): Promise<AuthenticationResult>;
|
|
18
|
-
/**
|
|
19
|
-
* makes a network call to acquire tokens by exchanging RefreshToken available in userCache; throws if refresh token is not cached
|
|
20
|
-
* @param request
|
|
21
|
-
*/
|
|
22
|
-
private acquireTokenWithCachedRefreshToken;
|
|
23
|
-
/**
|
|
24
|
-
* Constructs the network message and makes a NW call to the underlying secure token service
|
|
25
|
-
* @param request
|
|
26
|
-
* @param authority
|
|
27
|
-
*/
|
|
28
|
-
private executeTokenRequest;
|
|
29
|
-
/**
|
|
30
|
-
* Helper function to create the token request body
|
|
31
|
-
* @param request
|
|
32
|
-
*/
|
|
33
|
-
private createTokenRequestBody;
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=RefreshTokenClient.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RefreshTokenClient.d.ts","sourceRoot":"","sources":["../../src/client/RefreshTokenClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAWjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAKxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAa7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACjF;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,UAAU;gBAE1C,aAAa,EAAE,mBAAmB,EAClC,iBAAiB,CAAC,EAAE,kBAAkB;IAI7B,YAAY,CACrB,OAAO,EAAE,yBAAyB,GACnC,OAAO,CAAC,oBAAoB,CAAC;IAiFhC;;;OAGG;IACU,0BAA0B,CACnC,OAAO,EAAE,uBAAuB,GACjC,OAAO,CAAC,oBAAoB,CAAC;IAgEhC;;;OAGG;YACW,kCAAkC;IAmDhD;;;;OAIG;YACW,mBAAmB;IA4DjC;;;OAGG;YACW,sBAAsB;CAqHvC"}
|
|
@@ -1,260 +0,0 @@
|
|
|
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 { GrantType, AuthenticationScheme, HeaderNames, Errors } from '../utils/Constants.js';
|
|
6
|
-
import { ResponseHandler } from '../response/ResponseHandler.js';
|
|
7
|
-
import { PopTokenGenerator } from '../crypto/PopTokenGenerator.js';
|
|
8
|
-
import { StringUtils } from '../utils/StringUtils.js';
|
|
9
|
-
import { ClientConfigurationError } from '../error/ClientConfigurationError.js';
|
|
10
|
-
import { ClientAuthError } from '../error/ClientAuthError.js';
|
|
11
|
-
import { ServerError } from '../error/ServerError.js';
|
|
12
|
-
import { TimeUtils } from '../utils/TimeUtils.js';
|
|
13
|
-
import { UrlString } from '../url/UrlString.js';
|
|
14
|
-
import { CcsCredentialType } from '../account/CcsCredential.js';
|
|
15
|
-
import { buildClientInfoFromHomeAccountId } from '../account/ClientInfo.js';
|
|
16
|
-
import { InteractionRequiredAuthError, InteractionRequiredAuthErrorMessage } from '../error/InteractionRequiredAuthError.js';
|
|
17
|
-
import { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.js';
|
|
18
|
-
|
|
19
|
-
/*
|
|
20
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
21
|
-
* Licensed under the MIT License.
|
|
22
|
-
*/
|
|
23
|
-
/**
|
|
24
|
-
* OAuth2.0 refresh token client
|
|
25
|
-
*/
|
|
26
|
-
class RefreshTokenClient extends BaseClient {
|
|
27
|
-
constructor(configuration, performanceClient) {
|
|
28
|
-
super(configuration, performanceClient);
|
|
29
|
-
}
|
|
30
|
-
async acquireToken(request) {
|
|
31
|
-
this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);
|
|
32
|
-
const atsMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);
|
|
33
|
-
this.logger.verbose("RefreshTokenClientAcquireToken called", request.correlationId);
|
|
34
|
-
const reqTimestamp = TimeUtils.nowSeconds();
|
|
35
|
-
this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);
|
|
36
|
-
const response = await this.executeTokenRequest(request, this.authority);
|
|
37
|
-
const httpVerToken = response.headers?.[HeaderNames.X_MS_HTTP_VERSION];
|
|
38
|
-
atsMeasurement?.addStaticFields({
|
|
39
|
-
refreshTokenSize: response.body.refresh_token?.length || 0,
|
|
40
|
-
});
|
|
41
|
-
if (httpVerToken) {
|
|
42
|
-
atsMeasurement?.addStaticFields({
|
|
43
|
-
httpVerToken,
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
// Retrieve requestId from response headers
|
|
47
|
-
const requestId = response.headers?.[HeaderNames.X_MS_REQUEST_ID];
|
|
48
|
-
const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin);
|
|
49
|
-
responseHandler.validateTokenResponse(response.body);
|
|
50
|
-
this.performanceClient?.setPreQueueTime(PerformanceEvents.HandleServerTokenResponse, request.correlationId);
|
|
51
|
-
return responseHandler
|
|
52
|
-
.handleServerTokenResponse(response.body, this.authority, reqTimestamp, request, undefined, undefined, true, request.forceCache, requestId)
|
|
53
|
-
.then((result) => {
|
|
54
|
-
atsMeasurement?.endMeasurement({
|
|
55
|
-
success: true,
|
|
56
|
-
});
|
|
57
|
-
return result;
|
|
58
|
-
})
|
|
59
|
-
.catch((error) => {
|
|
60
|
-
this.logger.verbose("Error in fetching refresh token", request.correlationId);
|
|
61
|
-
atsMeasurement?.endMeasurement({
|
|
62
|
-
errorCode: error.errorCode,
|
|
63
|
-
subErrorCode: error.subError,
|
|
64
|
-
success: false,
|
|
65
|
-
});
|
|
66
|
-
throw error;
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Gets cached refresh token and attaches to request, then calls acquireToken API
|
|
71
|
-
* @param request
|
|
72
|
-
*/
|
|
73
|
-
async acquireTokenByRefreshToken(request) {
|
|
74
|
-
// Cannot renew token if no request object is given.
|
|
75
|
-
if (!request) {
|
|
76
|
-
throw ClientConfigurationError.createEmptyTokenRequestError();
|
|
77
|
-
}
|
|
78
|
-
this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientAcquireTokenByRefreshToken, request.correlationId);
|
|
79
|
-
// We currently do not support silent flow for account === null use cases; This will be revisited for confidential flow usecases
|
|
80
|
-
if (!request.account) {
|
|
81
|
-
throw ClientAuthError.createNoAccountInSilentRequestError();
|
|
82
|
-
}
|
|
83
|
-
// try checking if FOCI is enabled for the given application
|
|
84
|
-
const isFOCI = this.cacheManager.isAppMetadataFOCI(request.account.environment);
|
|
85
|
-
// if the app is part of the family, retrive a Family refresh token if present and make a refreshTokenRequest
|
|
86
|
-
if (isFOCI) {
|
|
87
|
-
try {
|
|
88
|
-
this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
|
|
89
|
-
return this.acquireTokenWithCachedRefreshToken(request, true);
|
|
90
|
-
}
|
|
91
|
-
catch (e) {
|
|
92
|
-
const noFamilyRTInCache = e instanceof InteractionRequiredAuthError &&
|
|
93
|
-
e.errorCode ===
|
|
94
|
-
InteractionRequiredAuthErrorMessage.noTokensFoundError
|
|
95
|
-
.code;
|
|
96
|
-
const clientMismatchErrorWithFamilyRT = e instanceof ServerError &&
|
|
97
|
-
e.errorCode === Errors.INVALID_GRANT_ERROR &&
|
|
98
|
-
e.subError === Errors.CLIENT_MISMATCH_ERROR;
|
|
99
|
-
// if family Refresh Token (FRT) cache acquisition fails or if client_mismatch error is seen with FRT, reattempt with application Refresh Token (ART)
|
|
100
|
-
if (noFamilyRTInCache || clientMismatchErrorWithFamilyRT) {
|
|
101
|
-
this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
|
|
102
|
-
return this.acquireTokenWithCachedRefreshToken(request, false);
|
|
103
|
-
// throw in all other cases
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
throw e;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
// fall back to application refresh token acquisition
|
|
111
|
-
this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
|
|
112
|
-
return this.acquireTokenWithCachedRefreshToken(request, false);
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* makes a network call to acquire tokens by exchanging RefreshToken available in userCache; throws if refresh token is not cached
|
|
116
|
-
* @param request
|
|
117
|
-
*/
|
|
118
|
-
async acquireTokenWithCachedRefreshToken(request, foci) {
|
|
119
|
-
this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
|
|
120
|
-
// fetches family RT or application RT based on FOCI value
|
|
121
|
-
const atsMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
|
|
122
|
-
this.logger.verbose("RefreshTokenClientAcquireTokenWithCachedRefreshToken called", request.correlationId);
|
|
123
|
-
const refreshToken = this.cacheManager.getRefreshToken(request.account, foci);
|
|
124
|
-
if (!refreshToken) {
|
|
125
|
-
atsMeasurement?.discardMeasurement();
|
|
126
|
-
throw InteractionRequiredAuthError.createNoTokensFoundError();
|
|
127
|
-
}
|
|
128
|
-
// attach cached RT size to the current measurement
|
|
129
|
-
atsMeasurement?.endMeasurement({
|
|
130
|
-
success: true,
|
|
131
|
-
});
|
|
132
|
-
const refreshTokenRequest = {
|
|
133
|
-
...request,
|
|
134
|
-
refreshToken: refreshToken.secret,
|
|
135
|
-
authenticationScheme: request.authenticationScheme || AuthenticationScheme.BEARER,
|
|
136
|
-
ccsCredential: {
|
|
137
|
-
credential: request.account.homeAccountId,
|
|
138
|
-
type: CcsCredentialType.HOME_ACCOUNT_ID,
|
|
139
|
-
},
|
|
140
|
-
};
|
|
141
|
-
this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);
|
|
142
|
-
return this.acquireToken(refreshTokenRequest);
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Constructs the network message and makes a NW call to the underlying secure token service
|
|
146
|
-
* @param request
|
|
147
|
-
* @param authority
|
|
148
|
-
*/
|
|
149
|
-
async executeTokenRequest(request, authority) {
|
|
150
|
-
this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);
|
|
151
|
-
const acquireTokenMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);
|
|
152
|
-
this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientCreateTokenRequestBody, request.correlationId);
|
|
153
|
-
const queryParametersString = this.createTokenQueryParameters(request);
|
|
154
|
-
const endpoint = UrlString.appendQueryString(authority.tokenEndpoint, queryParametersString);
|
|
155
|
-
const requestBody = await this.createTokenRequestBody(request);
|
|
156
|
-
const headers = this.createTokenRequestHeaders(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
|
-
.then((result) => {
|
|
170
|
-
acquireTokenMeasurement?.endMeasurement({
|
|
171
|
-
success: true,
|
|
172
|
-
});
|
|
173
|
-
return result;
|
|
174
|
-
})
|
|
175
|
-
.catch((error) => {
|
|
176
|
-
acquireTokenMeasurement?.endMeasurement({
|
|
177
|
-
success: false,
|
|
178
|
-
});
|
|
179
|
-
throw error;
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Helper function to create the token request body
|
|
184
|
-
* @param request
|
|
185
|
-
*/
|
|
186
|
-
async createTokenRequestBody(request) {
|
|
187
|
-
this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientCreateTokenRequestBody, request.correlationId);
|
|
188
|
-
const correlationId = request.correlationId;
|
|
189
|
-
const acquireTokenMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.BaseClientCreateTokenRequestHeaders, correlationId);
|
|
190
|
-
const parameterBuilder = new RequestParameterBuilder();
|
|
191
|
-
parameterBuilder.addClientId(this.config.authOptions.clientId);
|
|
192
|
-
parameterBuilder.addScopes(request.scopes);
|
|
193
|
-
parameterBuilder.addGrantType(GrantType.REFRESH_TOKEN_GRANT);
|
|
194
|
-
parameterBuilder.addClientInfo();
|
|
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
|
-
parameterBuilder.addCorrelationId(correlationId);
|
|
202
|
-
parameterBuilder.addRefreshToken(request.refreshToken);
|
|
203
|
-
if (this.config.clientCredentials.clientSecret) {
|
|
204
|
-
parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);
|
|
205
|
-
}
|
|
206
|
-
if (this.config.clientCredentials.clientAssertion) {
|
|
207
|
-
const clientAssertion = this.config.clientCredentials.clientAssertion;
|
|
208
|
-
parameterBuilder.addClientAssertion(clientAssertion.assertion);
|
|
209
|
-
parameterBuilder.addClientAssertionType(clientAssertion.assertionType);
|
|
210
|
-
}
|
|
211
|
-
if (request.authenticationScheme === AuthenticationScheme.POP) {
|
|
212
|
-
const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.performanceClient);
|
|
213
|
-
this.performanceClient?.setPreQueueTime(PerformanceEvents.PopTokenGenerateCnf, request.correlationId);
|
|
214
|
-
const reqCnfData = await popTokenGenerator.generateCnf(request);
|
|
215
|
-
// SPA PoP requires full Base64Url encoded req_cnf string (unhashed)
|
|
216
|
-
parameterBuilder.addPopToken(reqCnfData.reqCnfString);
|
|
217
|
-
}
|
|
218
|
-
else if (request.authenticationScheme === AuthenticationScheme.SSH) {
|
|
219
|
-
if (request.sshJwk) {
|
|
220
|
-
parameterBuilder.addSshJwk(request.sshJwk);
|
|
221
|
-
}
|
|
222
|
-
else {
|
|
223
|
-
acquireTokenMeasurement?.endMeasurement({
|
|
224
|
-
success: false,
|
|
225
|
-
});
|
|
226
|
-
throw ClientConfigurationError.createMissingSshJwkError();
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
if (!StringUtils.isEmptyObj(request.claims) ||
|
|
230
|
-
(this.config.authOptions.clientCapabilities &&
|
|
231
|
-
this.config.authOptions.clientCapabilities.length > 0)) {
|
|
232
|
-
parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);
|
|
233
|
-
}
|
|
234
|
-
if (this.config.systemOptions.preventCorsPreflight &&
|
|
235
|
-
request.ccsCredential) {
|
|
236
|
-
switch (request.ccsCredential.type) {
|
|
237
|
-
case CcsCredentialType.HOME_ACCOUNT_ID:
|
|
238
|
-
try {
|
|
239
|
-
const clientInfo = buildClientInfoFromHomeAccountId(request.ccsCredential.credential);
|
|
240
|
-
parameterBuilder.addCcsOid(clientInfo);
|
|
241
|
-
}
|
|
242
|
-
catch (e) {
|
|
243
|
-
this.logger.verbose("Could not parse home account ID for CCS Header: " +
|
|
244
|
-
e);
|
|
245
|
-
}
|
|
246
|
-
break;
|
|
247
|
-
case CcsCredentialType.UPN:
|
|
248
|
-
parameterBuilder.addCcsUpn(request.ccsCredential.credential);
|
|
249
|
-
break;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
acquireTokenMeasurement?.endMeasurement({
|
|
253
|
-
success: true,
|
|
254
|
-
});
|
|
255
|
-
return parameterBuilder.createQueryString();
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
export { RefreshTokenClient };
|
|
260
|
-
//# sourceMappingURL=RefreshTokenClient.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RefreshTokenClient.js","sources":["../../src/client/RefreshTokenClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;AAGG;AAkCH;;AAEG;AACG,MAAO,kBAAmB,SAAQ,UAAU,CAAA;IAC9C,WACI,CAAA,aAAkC,EAClC,iBAAsC,EAAA;AAEtC,QAAA,KAAK,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAC;KAC3C;IACM,MAAM,YAAY,CACrB,OAAkC,EAAA;AAElC,QAAA,IAAI,CAAC,iBAAiB,EAAE,mBAAmB,CACvC,iBAAiB,CAAC,8BAA8B,EAChD,OAAO,CAAC,aAAa,CACxB,CAAC;AAEF,QAAA,MAAM,cAAc,GAAG,IAAI,CAAC,iBAAiB,EAAE,gBAAgB,CAC3D,iBAAiB,CAAC,8BAA8B,EAChD,OAAO,CAAC,aAAa,CACxB,CAAC;QACF,IAAI,CAAC,MAAM,CAAC,OAAO,CACf,uCAAuC,EACvC,OAAO,CAAC,aAAa,CACxB,CAAC;AACF,QAAA,MAAM,YAAY,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC;AAC5C,QAAA,IAAI,CAAC,iBAAiB,EAAE,eAAe,CACnC,iBAAiB,CAAC,qCAAqC,EACvD,OAAO,CAAC,aAAa,CACxB,CAAC;AACF,QAAA,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAC3C,OAAO,EACP,IAAI,CAAC,SAAS,CACjB,CAAC;QACF,MAAM,YAAY,GAAG,QAAQ,CAAC,OAAO,GAAG,WAAW,CAAC,iBAAiB,CAAC,CAAC;QACvE,cAAc,EAAE,e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C,aAAa,CAAC,oBAAoB;YAC9C,OAAO,CAAC,aAAa,EACvB;AACE,YAAA,QAAQ,OAAO,CAAC,aAAa,CAAC,IAAI;gBAC9B,KAAK,iBAAiB,CAAC,eAAe;oBAClC,IAAI;wBACA,MAAM,UAAU,GAAG,gCAAgC,CAC/C,OAAO,CAAC,aAAa,CAAC,UAAU,CACnC,CAAC;AACF,wBAAA,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AAC1C,qBAAA;AAAC,oBAAA,OAAO,CAAC,EAAE;AACR,wBAAA,IAAI,CAAC,MAAM,CAAC,OAAO,CACf,kDAAkD;AAC9C,4BAAA,CAAC,CACR,CAAC;AACL,qBAAA;oBACD,MAAM;gBACV,KAAK,iBAAiB,CAAC,GAAG;oBACtB,gBAAgB,CAAC,SAAS,CACtB,OAAO,CAAC,aAAa,CAAC,UAAU,CACnC,CAAC;oBACF,MAAM;AACb,aAAA;AACJ,SAAA;QACD,uBAAuB,EAAE,cAAc,CAAC;AACpC,YAAA,OAAO,EAAE,IAAI;AAChB,SAAA,CAAC,CAAC;AACH,QAAA,OAAO,gBAAgB,CAAC,iBAAiB,EAAE,CAAC;KAC/C;AACJ;;;;"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { BaseClient } from "./BaseClient";
|
|
2
|
-
import { ClientConfiguration } from "../config/ClientConfiguration";
|
|
3
|
-
import { CommonSilentFlowRequest } from "../request/CommonSilentFlowRequest";
|
|
4
|
-
import { AuthenticationResult } from "../response/AuthenticationResult";
|
|
5
|
-
import { IPerformanceClient } from "../telemetry/performance/IPerformanceClient";
|
|
6
|
-
export declare class SilentFlowClient extends BaseClient {
|
|
7
|
-
constructor(configuration: ClientConfiguration, performanceClient?: IPerformanceClient);
|
|
8
|
-
/**
|
|
9
|
-
* Retrieves a token from cache if it is still valid, or uses the cached refresh token to renew
|
|
10
|
-
* the given token and returns the renewed token
|
|
11
|
-
* @param request
|
|
12
|
-
*/
|
|
13
|
-
acquireToken(request: CommonSilentFlowRequest): Promise<AuthenticationResult>;
|
|
14
|
-
/**
|
|
15
|
-
* Retrieves token from cache or throws an error if it must be refreshed.
|
|
16
|
-
* @param request
|
|
17
|
-
*/
|
|
18
|
-
acquireCachedToken(request: CommonSilentFlowRequest): Promise<AuthenticationResult>;
|
|
19
|
-
/**
|
|
20
|
-
* Helper function to build response object from the CacheRecord
|
|
21
|
-
* @param cacheRecord
|
|
22
|
-
*/
|
|
23
|
-
private generateResultFromCacheRecord;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=SilentFlowClient.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SilentFlowClient.d.ts","sourceRoot":"","sources":["../../src/client/SilentFlowClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAYxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAEjF,qBAAa,gBAAiB,SAAQ,UAAU;gBAExC,aAAa,EAAE,mBAAmB,EAClC,iBAAiB,CAAC,EAAE,kBAAkB;IAK1C;;;;OAIG;IACG,YAAY,CACd,OAAO,EAAE,uBAAuB,GACjC,OAAO,CAAC,oBAAoB,CAAC;IAmBhC;;;OAGG;IACG,kBAAkB,CACpB,OAAO,EAAE,uBAAuB,GACjC,OAAO,CAAC,oBAAoB,CAAC;IA4EhC;;;OAGG;YACW,6BAA6B;CA+B9C"}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
/*! @azure/msal-common v14.0.0 2023-05-03 */
|
|
2
|
-
'use strict';
|
|
3
|
-
import { BaseClient } from './BaseClient.js';
|
|
4
|
-
import { AuthToken } from '../account/AuthToken.js';
|
|
5
|
-
import { TimeUtils } from '../utils/TimeUtils.js';
|
|
6
|
-
import { RefreshTokenClient } from './RefreshTokenClient.js';
|
|
7
|
-
import { ClientAuthError, ClientAuthErrorMessage } from '../error/ClientAuthError.js';
|
|
8
|
-
import { ClientConfigurationError } from '../error/ClientConfigurationError.js';
|
|
9
|
-
import { ResponseHandler } from '../response/ResponseHandler.js';
|
|
10
|
-
import { CacheOutcome } from '../utils/Constants.js';
|
|
11
|
-
|
|
12
|
-
/*
|
|
13
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
14
|
-
* Licensed under the MIT License.
|
|
15
|
-
*/
|
|
16
|
-
class SilentFlowClient extends BaseClient {
|
|
17
|
-
constructor(configuration, performanceClient) {
|
|
18
|
-
super(configuration, performanceClient);
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Retrieves a token from cache if it is still valid, or uses the cached refresh token to renew
|
|
22
|
-
* the given token and returns the renewed token
|
|
23
|
-
* @param request
|
|
24
|
-
*/
|
|
25
|
-
async acquireToken(request) {
|
|
26
|
-
try {
|
|
27
|
-
return await this.acquireCachedToken(request);
|
|
28
|
-
}
|
|
29
|
-
catch (e) {
|
|
30
|
-
if (e instanceof ClientAuthError &&
|
|
31
|
-
e.errorCode === ClientAuthErrorMessage.tokenRefreshRequired.code) {
|
|
32
|
-
const refreshTokenClient = new RefreshTokenClient(this.config, this.performanceClient);
|
|
33
|
-
return refreshTokenClient.acquireTokenByRefreshToken(request);
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
throw e;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Retrieves token from cache or throws an error if it must be refreshed.
|
|
42
|
-
* @param request
|
|
43
|
-
*/
|
|
44
|
-
async acquireCachedToken(request) {
|
|
45
|
-
// Cannot renew token if no request object is given.
|
|
46
|
-
if (!request) {
|
|
47
|
-
throw ClientConfigurationError.createEmptyTokenRequestError();
|
|
48
|
-
}
|
|
49
|
-
if (request.forceRefresh) {
|
|
50
|
-
// Must refresh due to present force_refresh flag.
|
|
51
|
-
this.serverTelemetryManager?.setCacheOutcome(CacheOutcome.FORCE_REFRESH);
|
|
52
|
-
this.logger.info("SilentFlowClient:acquireCachedToken - Skipping cache because forceRefresh is true.");
|
|
53
|
-
throw ClientAuthError.createRefreshRequiredError();
|
|
54
|
-
}
|
|
55
|
-
// We currently do not support silent flow for account === null use cases; This will be revisited for confidential flow usecases
|
|
56
|
-
if (!request.account) {
|
|
57
|
-
throw ClientAuthError.createNoAccountInSilentRequestError();
|
|
58
|
-
}
|
|
59
|
-
const environment = request.authority || this.authority.getPreferredCache();
|
|
60
|
-
const cacheRecord = this.cacheManager.readCacheRecord(request.account, request, environment);
|
|
61
|
-
if (!cacheRecord.accessToken) {
|
|
62
|
-
// Must refresh due to non-existent access_token.
|
|
63
|
-
this.serverTelemetryManager?.setCacheOutcome(CacheOutcome.NO_CACHED_ACCESS_TOKEN);
|
|
64
|
-
this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties.");
|
|
65
|
-
throw ClientAuthError.createRefreshRequiredError();
|
|
66
|
-
}
|
|
67
|
-
else if (TimeUtils.wasClockTurnedBack(cacheRecord.accessToken.cachedAt) ||
|
|
68
|
-
TimeUtils.isTokenExpired(cacheRecord.accessToken.expiresOn, this.config.systemOptions.tokenRenewalOffsetSeconds)) {
|
|
69
|
-
// Must refresh due to expired access_token.
|
|
70
|
-
this.serverTelemetryManager?.setCacheOutcome(CacheOutcome.CACHED_ACCESS_TOKEN_EXPIRED);
|
|
71
|
-
this.logger.info(`SilentFlowClient:acquireCachedToken - Cached access token is expired or will expire within ${this.config.systemOptions.tokenRenewalOffsetSeconds} seconds.`);
|
|
72
|
-
throw ClientAuthError.createRefreshRequiredError();
|
|
73
|
-
}
|
|
74
|
-
else if (cacheRecord.accessToken.refreshOn &&
|
|
75
|
-
TimeUtils.isTokenExpired(cacheRecord.accessToken.refreshOn, 0)) {
|
|
76
|
-
// Must refresh due to the refresh_in value.
|
|
77
|
-
this.serverTelemetryManager?.setCacheOutcome(CacheOutcome.REFRESH_CACHED_ACCESS_TOKEN);
|
|
78
|
-
this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'.");
|
|
79
|
-
throw ClientAuthError.createRefreshRequiredError();
|
|
80
|
-
}
|
|
81
|
-
if (this.config.serverTelemetryManager) {
|
|
82
|
-
this.config.serverTelemetryManager.incrementCacheHits();
|
|
83
|
-
}
|
|
84
|
-
return await this.generateResultFromCacheRecord(cacheRecord, request);
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Helper function to build response object from the CacheRecord
|
|
88
|
-
* @param cacheRecord
|
|
89
|
-
*/
|
|
90
|
-
async generateResultFromCacheRecord(cacheRecord, request) {
|
|
91
|
-
let idTokenObj;
|
|
92
|
-
if (cacheRecord.idToken) {
|
|
93
|
-
idTokenObj = new AuthToken(cacheRecord.idToken.secret, this.config.cryptoInterface);
|
|
94
|
-
}
|
|
95
|
-
// token max_age check
|
|
96
|
-
if (request.maxAge || request.maxAge === 0) {
|
|
97
|
-
const authTime = idTokenObj?.claims.auth_time;
|
|
98
|
-
if (!authTime) {
|
|
99
|
-
throw ClientAuthError.createAuthTimeNotFoundError();
|
|
100
|
-
}
|
|
101
|
-
AuthToken.checkMaxAge(authTime, request.maxAge);
|
|
102
|
-
}
|
|
103
|
-
return await ResponseHandler.generateAuthenticationResult(this.cryptoUtils, this.authority, cacheRecord, true, request, idTokenObj);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export { SilentFlowClient };
|
|
108
|
-
//# sourceMappingURL=SilentFlowClient.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SilentFlowClient.js","sources":["../../src/client/SilentFlowClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;AAAA;;;AAGG;AAmBG,MAAO,gBAAiB,SAAQ,UAAU,C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IAAI,CAAC,MAAM,CAAC,sBAAsB,EAAE;AACpC,YAAA,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,kBAAkB,EAAE,CAAC;AAC3D,SAAA;QAED,OAAO,MAAM,IAAI,CAAC,6BAA6B,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;KACzE;AAED;;;AAGG;AACK,IAAA,MAAM,6BAA6B,CACvC,WAAwB,EACxB,OAAgC,EAAA;AAEhC,QAAA,IAAI,UAAiC,CAAC;QACtC,IAAI,WAAW,CAAC,OAAO,EAAE;AACrB,YAAA,UAAU,GAAG,IAAI,SAAS,CACtB,WAAW,CAAC,OAAO,CAAC,MAAM,EAC1B,IAAI,CAAC,MAAM,CAAC,eAAe,CAC9B,CAAC;AACL,SAAA;;QAGD,IAAI,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;AACxC,YAAA,MAAM,QAAQ,GAAG,UAAU,EAAE,MAAM,CAAC,SAAS,CAAC;YAC9C,IAAI,CAAC,QAAQ,EAAE;AACX,gBAAA,MAAM,eAAe,CAAC,2BAA2B,EAAE,CAAC;AACvD,aAAA;YAED,SAAS,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;AACnD,SAAA;QAED,OAAO,MAAM,eAAe,CAAC,4BAA4B,CACrD,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,SAAS,EACd,WAAW,EACX,IAAI,EACJ,OAAO,EACP,UAAU,CACb,CAAC;KACL;AACJ;;;;"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Extensibility interface, which allows the app developer to return a token, based on the passed-in parameters, instead of fetching tokens from
|
|
3
|
-
* the Identity Provider (AAD).
|
|
4
|
-
* Developers need to construct and return an AppTokenProviderResult object back to MSAL. MSAL will cache the token response
|
|
5
|
-
* in the same way it would do if the result were comming from AAD.
|
|
6
|
-
* This extensibility point is only defined for the client_credential flow, i.e. acquireTokenByClientCredential and
|
|
7
|
-
* meant for Azure SDK to enhance Managed Identity support.
|
|
8
|
-
*/
|
|
9
|
-
export interface IAppTokenProvider {
|
|
10
|
-
(appTokenProviderParameters: AppTokenProviderParameters): Promise<AppTokenProviderResult>;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Input object for the IAppTokenProvider extensiblity. MSAL will create this object, which can be used
|
|
14
|
-
* to help create an AppTokenProviderResult.
|
|
15
|
-
*
|
|
16
|
-
* - correlationId - the correlation Id associated with the request
|
|
17
|
-
* - tenantId - the tenant Id for which the token must be provided
|
|
18
|
-
* - scopes - the scopes for which the token must be provided
|
|
19
|
-
* - claims - any extra claims that the token must satisfy
|
|
20
|
-
*/
|
|
21
|
-
export type AppTokenProviderParameters = {
|
|
22
|
-
readonly correlationId?: string;
|
|
23
|
-
readonly tenantId: string;
|
|
24
|
-
readonly scopes: Array<string>;
|
|
25
|
-
readonly claims?: string;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Output object for IAppTokenProvider extensiblity.
|
|
29
|
-
*
|
|
30
|
-
* - accessToken - the actual access token, typically in JWT format, that satisfies the request data AppTokenProviderParameters
|
|
31
|
-
* - expiresInSeconds - how long the tokens has before expiry, in seconds. Similar to the "expires_in" field in an AAD token response.
|
|
32
|
-
* - refreshInSeconds - how long the token has before it should be proactively refreshed. Similar to the "refresh_in" field in an AAD token response.
|
|
33
|
-
*/
|
|
34
|
-
export type AppTokenProviderResult = {
|
|
35
|
-
accessToken: string;
|
|
36
|
-
expiresInSeconds: number;
|
|
37
|
-
refreshInSeconds?: number;
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=AppTokenProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AppTokenProvider.d.ts","sourceRoot":"","sources":["../../src/config/AppTokenProvider.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAC9B,CACI,0BAA0B,EAAE,0BAA0B,GACvD,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACtC;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACrC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC/B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC"}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { INetworkModule } from "../network/INetworkModule";
|
|
2
|
-
import { ICrypto } from "../crypto/ICrypto";
|
|
3
|
-
import { ILoggerCallback, LogLevel } from "../logger/Logger";
|
|
4
|
-
import { Authority } from "../authority/Authority";
|
|
5
|
-
import { AzureCloudInstance } from "../authority/AuthorityOptions";
|
|
6
|
-
import { CacheManager } from "../cache/CacheManager";
|
|
7
|
-
import { ServerTelemetryManager } from "../telemetry/server/ServerTelemetryManager";
|
|
8
|
-
import { ICachePlugin } from "../cache/interface/ICachePlugin";
|
|
9
|
-
import { ISerializableTokenCache } from "../cache/interface/ISerializableTokenCache";
|
|
10
|
-
import { ClientCredentials } from "../account/ClientCredentials";
|
|
11
|
-
/**
|
|
12
|
-
* Use the configuration object to configure MSAL Modules and initialize the base interfaces for MSAL.
|
|
13
|
-
*
|
|
14
|
-
* This object allows you to configure important elements of MSAL functionality:
|
|
15
|
-
* - authOptions - Authentication for application
|
|
16
|
-
* - cryptoInterface - Implementation of crypto functions
|
|
17
|
-
* - libraryInfo - Library metadata
|
|
18
|
-
* - telemetry - Telemetry options and data
|
|
19
|
-
* - loggerOptions - Logging for application
|
|
20
|
-
* - networkInterface - Network implementation
|
|
21
|
-
* - storageInterface - Storage implementation
|
|
22
|
-
* - systemOptions - Additional library options
|
|
23
|
-
* - clientCredentials - Credentials options for confidential clients
|
|
24
|
-
*/
|
|
25
|
-
export type ClientConfiguration = {
|
|
26
|
-
authOptions: AuthOptions;
|
|
27
|
-
systemOptions?: SystemOptions;
|
|
28
|
-
loggerOptions?: LoggerOptions;
|
|
29
|
-
storageInterface?: CacheManager;
|
|
30
|
-
networkInterface?: INetworkModule;
|
|
31
|
-
cryptoInterface?: ICrypto;
|
|
32
|
-
clientCredentials?: ClientCredentials;
|
|
33
|
-
libraryInfo?: LibraryInfo;
|
|
34
|
-
telemetry?: TelemetryOptions;
|
|
35
|
-
serverTelemetryManager?: ServerTelemetryManager | null;
|
|
36
|
-
persistencePlugin?: ICachePlugin | null;
|
|
37
|
-
serializableCache?: ISerializableTokenCache | null;
|
|
38
|
-
};
|
|
39
|
-
export type CommonClientConfiguration = {
|
|
40
|
-
authOptions: Required<AuthOptions>;
|
|
41
|
-
systemOptions: Required<SystemOptions>;
|
|
42
|
-
loggerOptions: Required<LoggerOptions>;
|
|
43
|
-
storageInterface: CacheManager;
|
|
44
|
-
networkInterface: INetworkModule;
|
|
45
|
-
cryptoInterface: Required<ICrypto>;
|
|
46
|
-
libraryInfo: LibraryInfo;
|
|
47
|
-
telemetry: Required<TelemetryOptions>;
|
|
48
|
-
serverTelemetryManager: ServerTelemetryManager | null;
|
|
49
|
-
clientCredentials: ClientCredentials;
|
|
50
|
-
persistencePlugin: ICachePlugin | null;
|
|
51
|
-
serializableCache: ISerializableTokenCache | null;
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* Use this to configure the auth options in the ClientConfiguration object
|
|
55
|
-
*
|
|
56
|
-
* - clientId - Client ID of your app registered with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview in Microsoft Identity Platform
|
|
57
|
-
* - authority - You can configure a specific authority, defaults to " " or "https://login.microsoftonline.com/common"
|
|
58
|
-
* - knownAuthorities - An array of URIs that are known to be valid. Used in B2C scenarios.
|
|
59
|
-
* - cloudDiscoveryMetadata - A string containing the cloud discovery response. Used in AAD scenarios.
|
|
60
|
-
* - clientCapabilities - Array of capabilities which will be added to the claims.access_token.xms_cc request property on every network request.
|
|
61
|
-
* - protocolMode - Enum that represents the protocol that msal follows. Used for configuring proper endpoints.
|
|
62
|
-
* - skipAuthorityMetadataCache - A flag to choose whether to use or not use the local metadata cache during authority initialization. Defaults to false.
|
|
63
|
-
*/
|
|
64
|
-
export type AuthOptions = {
|
|
65
|
-
clientId: string;
|
|
66
|
-
authority: Authority;
|
|
67
|
-
clientCapabilities?: Array<string>;
|
|
68
|
-
azureCloudOptions?: AzureCloudOptions;
|
|
69
|
-
skipAuthorityMetadataCache?: boolean;
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Use this to configure token renewal info in the Configuration object
|
|
73
|
-
*
|
|
74
|
-
* - tokenRenewalOffsetSeconds - Sets the window of offset needed to renew the token before expiry
|
|
75
|
-
*/
|
|
76
|
-
export type SystemOptions = {
|
|
77
|
-
tokenRenewalOffsetSeconds?: number;
|
|
78
|
-
preventCorsPreflight?: boolean;
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* Use this to configure the logging that MSAL does, by configuring logger options in the Configuration object
|
|
82
|
-
*
|
|
83
|
-
* - loggerCallback - Callback for logger
|
|
84
|
-
* - piiLoggingEnabled - Sets whether pii logging is enabled
|
|
85
|
-
* - logLevel - Sets the level at which logging happens
|
|
86
|
-
* - correlationId - Sets the correlationId printed by the logger
|
|
87
|
-
*/
|
|
88
|
-
export type LoggerOptions = {
|
|
89
|
-
loggerCallback?: ILoggerCallback;
|
|
90
|
-
piiLoggingEnabled?: boolean;
|
|
91
|
-
logLevel?: LogLevel;
|
|
92
|
-
correlationId?: string;
|
|
93
|
-
};
|
|
94
|
-
/**
|
|
95
|
-
* Library-specific options
|
|
96
|
-
*/
|
|
97
|
-
export type LibraryInfo = {
|
|
98
|
-
sku: string;
|
|
99
|
-
version: string;
|
|
100
|
-
cpu: string;
|
|
101
|
-
os: string;
|
|
102
|
-
};
|
|
103
|
-
/**
|
|
104
|
-
* AzureCloudInstance specific options
|
|
105
|
-
*
|
|
106
|
-
* - azureCloudInstance - string enum providing short notation for soverign and public cloud authorities
|
|
107
|
-
* - tenant - provision to provide the tenant info
|
|
108
|
-
*/
|
|
109
|
-
export type AzureCloudOptions = {
|
|
110
|
-
azureCloudInstance: AzureCloudInstance;
|
|
111
|
-
tenant?: string;
|
|
112
|
-
};
|
|
113
|
-
export type TelemetryOptions = {
|
|
114
|
-
application: ApplicationTelemetry;
|
|
115
|
-
};
|
|
116
|
-
/**
|
|
117
|
-
* Telemetry information sent on request
|
|
118
|
-
* - appName: Unique string name of an application
|
|
119
|
-
* - appVersion: Version of the application using MSAL
|
|
120
|
-
*/
|
|
121
|
-
export type ApplicationTelemetry = {
|
|
122
|
-
appName: string;
|
|
123
|
-
appVersion: string;
|
|
124
|
-
};
|
|
125
|
-
export declare const DEFAULT_SYSTEM_OPTIONS: Required<SystemOptions>;
|
|
126
|
-
/**
|
|
127
|
-
* Function that sets the default options when not explicitly configured from app developer
|
|
128
|
-
*
|
|
129
|
-
* @param Configuration
|
|
130
|
-
*
|
|
131
|
-
* @returns Configuration
|
|
132
|
-
*/
|
|
133
|
-
export declare function buildClientConfiguration({ authOptions: userAuthOptions, systemOptions: userSystemOptions, loggerOptions: userLoggerOption, storageInterface: storageImplementation, networkInterface: networkImplementation, cryptoInterface: cryptoImplementation, clientCredentials: clientCredentials, libraryInfo: libraryInfo, telemetry: telemetry, serverTelemetryManager: serverTelemetryManager, persistencePlugin: persistencePlugin, serializableCache: serializableCache, }: ClientConfiguration): CommonClientConfiguration;
|
|
134
|
-
//# sourceMappingURL=ClientConfiguration.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"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