@azure/msal-common 15.12.0 → 16.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/dist/account/AccountInfo.d.ts +0 -1
- package/dist/account/AccountInfo.d.ts.map +1 -1
- package/dist/account/AccountInfo.mjs +1 -1
- package/dist/account/AccountInfo.mjs.map +1 -1
- package/dist/account/AuthToken.mjs +1 -1
- package/dist/account/AuthToken.mjs.map +1 -1
- package/dist/account/CcsCredential.mjs +1 -1
- package/dist/account/CcsCredential.mjs.map +1 -1
- package/dist/account/ClientInfo.d.ts.map +1 -1
- package/dist/account/ClientInfo.mjs +4 -6
- package/dist/account/ClientInfo.mjs.map +1 -1
- package/dist/account/TokenClaims.mjs +1 -1
- package/dist/account/TokenClaims.mjs.map +1 -1
- package/dist/authority/Authority.d.ts +2 -2
- package/dist/authority/Authority.d.ts.map +1 -1
- package/dist/authority/Authority.mjs +89 -105
- package/dist/authority/Authority.mjs.map +1 -1
- package/dist/authority/AuthorityFactory.d.ts +6 -2
- package/dist/authority/AuthorityFactory.d.ts.map +1 -1
- package/dist/authority/AuthorityFactory.mjs +8 -5
- package/dist/authority/AuthorityFactory.mjs.map +1 -1
- package/dist/authority/AuthorityMetadata.d.ts +2 -2
- package/dist/authority/AuthorityMetadata.d.ts.map +1 -1
- package/dist/authority/AuthorityMetadata.mjs +8 -8
- package/dist/authority/AuthorityMetadata.mjs.map +1 -1
- package/dist/authority/AuthorityOptions.d.ts +0 -1
- package/dist/authority/AuthorityOptions.d.ts.map +1 -1
- package/dist/authority/AuthorityOptions.mjs +1 -1
- package/dist/authority/AuthorityOptions.mjs.map +1 -1
- package/dist/authority/AuthorityType.mjs +1 -1
- package/dist/authority/AuthorityType.mjs.map +1 -1
- package/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.mjs +1 -1
- package/dist/authority/OIDCOptions.d.ts +2 -2
- package/dist/authority/OIDCOptions.d.ts.map +1 -1
- package/dist/authority/OpenIdConfigResponse.mjs +1 -1
- package/dist/authority/ProtocolMode.mjs +1 -1
- package/dist/authority/ProtocolMode.mjs.map +1 -1
- package/dist/authority/RegionDiscovery.d.ts +3 -3
- package/dist/authority/RegionDiscovery.d.ts.map +1 -1
- package/dist/authority/RegionDiscovery.mjs +14 -15
- package/dist/authority/RegionDiscovery.mjs.map +1 -1
- package/dist/cache/CacheManager.d.ts +25 -17
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/CacheManager.mjs +69 -80
- package/dist/cache/CacheManager.mjs.map +1 -1
- package/dist/cache/entities/AccessTokenEntity.d.ts +0 -4
- package/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -1
- package/dist/cache/entities/AccountEntity.d.ts +4 -56
- package/dist/cache/entities/AccountEntity.d.ts.map +1 -1
- package/dist/cache/entities/CredentialEntity.d.ts +0 -2
- package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
- package/dist/cache/interface/ICacheManager.d.ts +41 -12
- package/dist/cache/interface/ICacheManager.d.ts.map +1 -1
- package/dist/cache/persistence/TokenCacheContext.mjs +1 -1
- package/dist/cache/persistence/TokenCacheContext.mjs.map +1 -1
- package/dist/cache/utils/AccountEntityUtils.d.ts +60 -0
- package/dist/cache/utils/AccountEntityUtils.d.ts.map +1 -0
- package/dist/cache/utils/AccountEntityUtils.mjs +212 -0
- package/dist/cache/utils/AccountEntityUtils.mjs.map +1 -0
- package/dist/cache/utils/CacheHelpers.d.ts +2 -2
- package/dist/cache/utils/CacheHelpers.d.ts.map +1 -1
- package/dist/cache/utils/CacheHelpers.mjs +10 -13
- package/dist/cache/utils/CacheHelpers.mjs.map +1 -1
- package/dist/cache/utils/CacheTypes.d.ts +0 -1
- package/dist/cache/utils/CacheTypes.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.d.ts +1 -1
- package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.mjs +16 -20
- package/dist/client/AuthorizationCodeClient.mjs.map +1 -1
- package/dist/client/BaseClient.d.ts +3 -3
- package/dist/client/BaseClient.d.ts.map +1 -1
- package/dist/client/BaseClient.mjs +7 -12
- package/dist/client/BaseClient.mjs.map +1 -1
- package/dist/client/RefreshTokenClient.d.ts +1 -1
- package/dist/client/RefreshTokenClient.d.ts.map +1 -1
- package/dist/client/RefreshTokenClient.mjs +22 -27
- package/dist/client/RefreshTokenClient.mjs.map +1 -1
- package/dist/client/SilentFlowClient.d.ts +1 -1
- package/dist/client/SilentFlowClient.d.ts.map +1 -1
- package/dist/client/SilentFlowClient.mjs +8 -12
- package/dist/client/SilentFlowClient.mjs.map +1 -1
- package/dist/config/ClientConfiguration.d.ts +2 -22
- package/dist/config/ClientConfiguration.d.ts.map +1 -1
- package/dist/config/ClientConfiguration.mjs +9 -15
- package/dist/config/ClientConfiguration.mjs.map +1 -1
- package/dist/constants/AADServerParamKeys.mjs +1 -1
- package/dist/crypto/ICrypto.d.ts +5 -3
- package/dist/crypto/ICrypto.d.ts.map +1 -1
- package/dist/crypto/ICrypto.mjs +1 -1
- package/dist/crypto/ICrypto.mjs.map +1 -1
- package/dist/crypto/JoseHeader.mjs +1 -1
- package/dist/crypto/JoseHeader.mjs.map +1 -1
- package/dist/crypto/PopTokenGenerator.d.ts +2 -2
- package/dist/crypto/PopTokenGenerator.d.ts.map +1 -1
- package/dist/crypto/PopTokenGenerator.mjs +3 -5
- package/dist/crypto/PopTokenGenerator.mjs.map +1 -1
- package/dist/error/AuthError.d.ts +1 -18
- package/dist/error/AuthError.d.ts.map +1 -1
- package/dist/error/AuthError.mjs +12 -34
- package/dist/error/AuthError.mjs.map +1 -1
- package/dist/error/AuthErrorCodes.mjs +1 -1
- package/dist/error/CacheError.d.ts +1 -6
- package/dist/error/CacheError.d.ts.map +1 -1
- package/dist/error/CacheError.mjs +6 -13
- package/dist/error/CacheError.mjs.map +1 -1
- package/dist/error/CacheErrorCodes.mjs +1 -1
- package/dist/error/ClientAuthError.d.ts +0 -224
- package/dist/error/ClientAuthError.d.ts.map +1 -1
- package/dist/error/ClientAuthError.mjs +3 -235
- package/dist/error/ClientAuthError.mjs.map +1 -1
- package/dist/error/ClientAuthErrorCodes.d.ts +0 -8
- package/dist/error/ClientAuthErrorCodes.d.ts.map +1 -1
- package/dist/error/ClientAuthErrorCodes.mjs +2 -10
- package/dist/error/ClientAuthErrorCodes.mjs.map +1 -1
- package/dist/error/ClientConfigurationError.d.ts +0 -123
- package/dist/error/ClientConfigurationError.d.ts.map +1 -1
- package/dist/error/ClientConfigurationError.mjs +3 -129
- package/dist/error/ClientConfigurationError.mjs.map +1 -1
- package/dist/error/ClientConfigurationErrorCodes.d.ts +0 -2
- package/dist/error/ClientConfigurationErrorCodes.d.ts.map +1 -1
- package/dist/error/ClientConfigurationErrorCodes.mjs +3 -5
- package/dist/error/ClientConfigurationErrorCodes.mjs.map +1 -1
- package/dist/error/InteractionRequiredAuthError.d.ts +1 -19
- package/dist/error/InteractionRequiredAuthError.d.ts.map +1 -1
- package/dist/error/InteractionRequiredAuthError.mjs +10 -35
- package/dist/error/InteractionRequiredAuthError.mjs.map +1 -1
- package/dist/error/InteractionRequiredAuthErrorCodes.mjs +1 -1
- package/dist/error/JoseHeaderError.d.ts +0 -4
- package/dist/error/JoseHeaderError.d.ts.map +1 -1
- package/dist/error/JoseHeaderError.mjs +3 -8
- package/dist/error/JoseHeaderError.mjs.map +1 -1
- package/dist/error/JoseHeaderErrorCodes.mjs +1 -1
- package/dist/error/NetworkError.mjs +1 -1
- package/dist/error/NetworkError.mjs.map +1 -1
- package/dist/error/ServerError.mjs +1 -1
- package/dist/error/ServerError.mjs.map +1 -1
- package/dist/exports-browser-only.d.ts +4 -3
- package/dist/exports-browser-only.d.ts.map +1 -1
- package/dist/exports-common.d.ts +8 -6
- package/dist/exports-common.d.ts.map +1 -1
- package/dist/exports-node-only.d.ts +1 -4
- package/dist/exports-node-only.d.ts.map +1 -1
- package/dist/index-browser.mjs +12 -8
- package/dist/index-browser.mjs.map +1 -1
- package/dist/index-node.mjs +10 -7
- package/dist/index-node.mjs.map +1 -1
- package/dist/index.mjs +12 -8
- package/dist/index.mjs.map +1 -1
- package/dist/logger/Logger.d.ts +12 -13
- package/dist/logger/Logger.d.ts.map +1 -1
- package/dist/logger/Logger.mjs +16 -21
- package/dist/logger/Logger.mjs.map +1 -1
- package/dist/network/INetworkModule.mjs +1 -1
- package/dist/network/INetworkModule.mjs.map +1 -1
- package/dist/network/RequestThumbprint.mjs +1 -1
- package/dist/network/ThrottlingUtils.d.ts.map +1 -1
- package/dist/network/ThrottlingUtils.mjs +6 -7
- package/dist/network/ThrottlingUtils.mjs.map +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.d.ts.map +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/protocol/Authorize.d.ts +1 -2
- package/dist/protocol/Authorize.d.ts.map +1 -1
- package/dist/protocol/Authorize.mjs +14 -14
- package/dist/protocol/Authorize.mjs.map +1 -1
- package/dist/request/AuthenticationHeaderParser.d.ts.map +1 -1
- package/dist/request/AuthenticationHeaderParser.mjs +3 -3
- package/dist/request/AuthenticationHeaderParser.mjs.map +1 -1
- package/dist/request/BaseAuthRequest.d.ts +1 -7
- package/dist/request/BaseAuthRequest.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.d.ts +3 -9
- package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.mjs +7 -20
- package/dist/request/RequestParameterBuilder.mjs.map +1 -1
- package/dist/request/ScopeSet.mjs +5 -5
- package/dist/request/ScopeSet.mjs.map +1 -1
- package/dist/response/AuthenticationResult.d.ts +1 -1
- package/dist/response/AuthenticationResult.d.ts.map +1 -1
- package/dist/response/ResponseHandler.d.ts +6 -5
- package/dist/response/ResponseHandler.d.ts.map +1 -1
- package/dist/response/ResponseHandler.mjs +39 -41
- package/dist/response/ResponseHandler.mjs.map +1 -1
- package/dist/telemetry/performance/IPerformanceClient.d.ts +0 -29
- package/dist/telemetry/performance/IPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.d.ts +5 -81
- package/dist/telemetry/performance/PerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.mjs +24 -166
- package/dist/telemetry/performance/PerformanceClient.mjs.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.d.ts +0 -280
- package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.mjs +2 -483
- package/dist/telemetry/performance/PerformanceEvent.mjs.map +1 -1
- package/dist/telemetry/performance/PerformanceEvents.d.ts +65 -0
- package/dist/telemetry/performance/PerformanceEvents.d.ts.map +1 -0
- package/dist/telemetry/performance/PerformanceEvents.mjs +73 -0
- package/dist/telemetry/performance/PerformanceEvents.mjs.map +1 -0
- package/dist/telemetry/performance/StubPerformanceClient.d.ts +0 -4
- package/dist/telemetry/performance/StubPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/StubPerformanceClient.mjs +2 -26
- package/dist/telemetry/performance/StubPerformanceClient.mjs.map +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.d.ts +2 -2
- package/dist/telemetry/server/ServerTelemetryManager.d.ts.map +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.mjs +28 -30
- package/dist/telemetry/server/ServerTelemetryManager.mjs.map +1 -1
- package/dist/url/UrlString.d.ts +0 -5
- package/dist/url/UrlString.d.ts.map +1 -1
- package/dist/url/UrlString.mjs +5 -13
- package/dist/url/UrlString.mjs.map +1 -1
- package/dist/utils/ClientAssertionUtils.mjs +1 -1
- package/dist/utils/ClientAssertionUtils.mjs.map +1 -1
- package/dist/utils/Constants.d.ts +81 -117
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.mjs +100 -131
- package/dist/utils/Constants.mjs.map +1 -1
- package/dist/utils/FunctionWrappers.d.ts +2 -2
- package/dist/utils/FunctionWrappers.d.ts.map +1 -1
- package/dist/utils/FunctionWrappers.mjs +19 -20
- package/dist/utils/FunctionWrappers.mjs.map +1 -1
- package/dist/utils/ProtocolUtils.mjs +7 -7
- package/dist/utils/ProtocolUtils.mjs.map +1 -1
- package/dist/utils/StringUtils.mjs +1 -1
- package/dist/utils/StringUtils.mjs.map +1 -1
- package/dist/utils/TimeUtils.mjs +1 -1
- package/dist/utils/TimeUtils.mjs.map +1 -1
- package/dist/utils/UrlUtils.d.ts +1 -2
- package/dist/utils/UrlUtils.d.ts.map +1 -1
- package/dist/utils/UrlUtils.mjs +3 -10
- package/dist/utils/UrlUtils.mjs.map +1 -1
- package/lib/index-browser.cjs +26 -201
- package/lib/index-browser.cjs.map +1 -1
- package/lib/{index-node-C8h2xZEM.js → index-node-FrCFfFuh.js} +1606 -2487
- package/lib/index-node-FrCFfFuh.js.map +1 -0
- package/lib/index-node.cjs +4 -33
- package/lib/index-node.cjs.map +1 -1
- package/lib/index.cjs +3 -33
- package/lib/index.cjs.map +1 -1
- package/lib/types/account/AccountInfo.d.ts +0 -1
- package/lib/types/account/AccountInfo.d.ts.map +1 -1
- package/lib/types/account/ClientInfo.d.ts.map +1 -1
- package/lib/types/authority/Authority.d.ts +2 -2
- package/lib/types/authority/Authority.d.ts.map +1 -1
- package/lib/types/authority/AuthorityFactory.d.ts +6 -2
- package/lib/types/authority/AuthorityFactory.d.ts.map +1 -1
- package/lib/types/authority/AuthorityMetadata.d.ts +2 -2
- package/lib/types/authority/AuthorityMetadata.d.ts.map +1 -1
- package/lib/types/authority/AuthorityOptions.d.ts +0 -1
- package/lib/types/authority/AuthorityOptions.d.ts.map +1 -1
- package/lib/types/authority/OIDCOptions.d.ts +2 -2
- package/lib/types/authority/OIDCOptions.d.ts.map +1 -1
- package/lib/types/authority/RegionDiscovery.d.ts +3 -3
- package/lib/types/authority/RegionDiscovery.d.ts.map +1 -1
- package/lib/types/cache/CacheManager.d.ts +25 -17
- package/lib/types/cache/CacheManager.d.ts.map +1 -1
- package/lib/types/cache/entities/AccessTokenEntity.d.ts +0 -4
- package/lib/types/cache/entities/AccessTokenEntity.d.ts.map +1 -1
- package/lib/types/cache/entities/AccountEntity.d.ts +4 -56
- package/lib/types/cache/entities/AccountEntity.d.ts.map +1 -1
- package/lib/types/cache/entities/CredentialEntity.d.ts +0 -2
- package/lib/types/cache/entities/CredentialEntity.d.ts.map +1 -1
- package/lib/types/cache/interface/ICacheManager.d.ts +41 -12
- package/lib/types/cache/interface/ICacheManager.d.ts.map +1 -1
- package/lib/types/cache/utils/AccountEntityUtils.d.ts +60 -0
- package/lib/types/cache/utils/AccountEntityUtils.d.ts.map +1 -0
- package/lib/types/cache/utils/CacheHelpers.d.ts +2 -2
- package/lib/types/cache/utils/CacheHelpers.d.ts.map +1 -1
- package/lib/types/cache/utils/CacheTypes.d.ts +0 -1
- package/lib/types/cache/utils/CacheTypes.d.ts.map +1 -1
- package/lib/types/client/AuthorizationCodeClient.d.ts +1 -1
- package/lib/types/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/lib/types/client/BaseClient.d.ts +3 -3
- package/lib/types/client/BaseClient.d.ts.map +1 -1
- package/lib/types/client/RefreshTokenClient.d.ts +1 -1
- package/lib/types/client/RefreshTokenClient.d.ts.map +1 -1
- package/lib/types/client/SilentFlowClient.d.ts +1 -1
- package/lib/types/client/SilentFlowClient.d.ts.map +1 -1
- package/lib/types/config/ClientConfiguration.d.ts +2 -22
- package/lib/types/config/ClientConfiguration.d.ts.map +1 -1
- package/lib/types/crypto/ICrypto.d.ts +5 -3
- package/lib/types/crypto/ICrypto.d.ts.map +1 -1
- package/lib/types/crypto/PopTokenGenerator.d.ts +2 -2
- package/lib/types/crypto/PopTokenGenerator.d.ts.map +1 -1
- package/lib/types/error/AuthError.d.ts +1 -18
- package/lib/types/error/AuthError.d.ts.map +1 -1
- package/lib/types/error/CacheError.d.ts +1 -6
- package/lib/types/error/CacheError.d.ts.map +1 -1
- package/lib/types/error/ClientAuthError.d.ts +0 -224
- package/lib/types/error/ClientAuthError.d.ts.map +1 -1
- package/lib/types/error/ClientAuthErrorCodes.d.ts +0 -8
- package/lib/types/error/ClientAuthErrorCodes.d.ts.map +1 -1
- package/lib/types/error/ClientConfigurationError.d.ts +0 -123
- package/lib/types/error/ClientConfigurationError.d.ts.map +1 -1
- package/lib/types/error/ClientConfigurationErrorCodes.d.ts +0 -2
- package/lib/types/error/ClientConfigurationErrorCodes.d.ts.map +1 -1
- package/lib/types/error/InteractionRequiredAuthError.d.ts +1 -19
- package/lib/types/error/InteractionRequiredAuthError.d.ts.map +1 -1
- package/lib/types/error/JoseHeaderError.d.ts +0 -4
- package/lib/types/error/JoseHeaderError.d.ts.map +1 -1
- package/lib/types/exports-browser-only.d.ts +4 -3
- package/lib/types/exports-browser-only.d.ts.map +1 -1
- package/lib/types/exports-common.d.ts +8 -6
- package/lib/types/exports-common.d.ts.map +1 -1
- package/lib/types/exports-node-only.d.ts +1 -4
- package/lib/types/exports-node-only.d.ts.map +1 -1
- package/lib/types/logger/Logger.d.ts +12 -13
- package/lib/types/logger/Logger.d.ts.map +1 -1
- package/lib/types/network/ThrottlingUtils.d.ts.map +1 -1
- package/lib/types/packageMetadata.d.ts +1 -1
- package/lib/types/packageMetadata.d.ts.map +1 -1
- package/lib/types/protocol/Authorize.d.ts +1 -2
- package/lib/types/protocol/Authorize.d.ts.map +1 -1
- package/lib/types/request/AuthenticationHeaderParser.d.ts.map +1 -1
- package/lib/types/request/BaseAuthRequest.d.ts +1 -7
- package/lib/types/request/BaseAuthRequest.d.ts.map +1 -1
- package/lib/types/request/RequestParameterBuilder.d.ts +3 -9
- package/lib/types/request/RequestParameterBuilder.d.ts.map +1 -1
- package/lib/types/response/AuthenticationResult.d.ts +1 -1
- package/lib/types/response/AuthenticationResult.d.ts.map +1 -1
- package/lib/types/response/ResponseHandler.d.ts +6 -5
- package/lib/types/response/ResponseHandler.d.ts.map +1 -1
- package/lib/types/telemetry/performance/IPerformanceClient.d.ts +0 -29
- package/lib/types/telemetry/performance/IPerformanceClient.d.ts.map +1 -1
- package/lib/types/telemetry/performance/PerformanceClient.d.ts +5 -81
- package/lib/types/telemetry/performance/PerformanceClient.d.ts.map +1 -1
- package/lib/types/telemetry/performance/PerformanceEvent.d.ts +0 -280
- package/lib/types/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
- package/lib/types/telemetry/performance/PerformanceEvents.d.ts +65 -0
- package/lib/types/telemetry/performance/PerformanceEvents.d.ts.map +1 -0
- package/lib/types/telemetry/performance/StubPerformanceClient.d.ts +0 -4
- package/lib/types/telemetry/performance/StubPerformanceClient.d.ts.map +1 -1
- package/lib/types/telemetry/server/ServerTelemetryManager.d.ts +2 -2
- package/lib/types/telemetry/server/ServerTelemetryManager.d.ts.map +1 -1
- package/lib/types/url/UrlString.d.ts +0 -5
- package/lib/types/url/UrlString.d.ts.map +1 -1
- package/lib/types/utils/Constants.d.ts +81 -117
- package/lib/types/utils/Constants.d.ts.map +1 -1
- package/lib/types/utils/FunctionWrappers.d.ts +2 -2
- package/lib/types/utils/FunctionWrappers.d.ts.map +1 -1
- package/lib/types/utils/UrlUtils.d.ts +1 -2
- package/lib/types/utils/UrlUtils.d.ts.map +1 -1
- package/package.json +120 -122
- package/src/account/AccountInfo.ts +0 -1
- package/src/account/ClientInfo.ts +3 -6
- package/src/authority/Authority.ts +145 -146
- package/src/authority/AuthorityFactory.ts +7 -7
- package/src/authority/AuthorityMetadata.ts +21 -12
- package/src/authority/AuthorityOptions.ts +0 -1
- package/src/authority/OIDCOptions.ts +2 -2
- package/src/authority/RegionDiscovery.ts +20 -33
- package/src/cache/CacheManager.ts +176 -126
- package/src/cache/entities/AccessTokenEntity.ts +0 -4
- package/src/cache/entities/AccountEntity.ts +4 -285
- package/src/cache/entities/CredentialEntity.ts +0 -2
- package/src/cache/interface/ICacheManager.ts +61 -15
- package/src/cache/utils/AccountEntityUtils.ts +287 -0
- package/src/cache/utils/CacheHelpers.ts +23 -37
- package/src/cache/utils/CacheTypes.ts +0 -1
- package/src/client/AuthorizationCodeClient.ts +28 -49
- package/src/client/BaseClient.ts +8 -20
- package/src/client/RefreshTokenClient.ts +29 -61
- package/src/client/SilentFlowClient.ts +11 -20
- package/src/config/ClientConfiguration.ts +9 -37
- package/src/crypto/ICrypto.ts +5 -3
- package/src/crypto/PopTokenGenerator.ts +3 -13
- package/src/error/AuthError.ts +11 -30
- package/src/error/CacheError.ts +4 -15
- package/src/error/ClientAuthError.ts +1 -311
- package/src/error/ClientAuthErrorCodes.ts +0 -8
- package/src/error/ClientConfigurationError.ts +1 -194
- package/src/error/ClientConfigurationErrorCodes.ts +0 -3
- package/src/error/InteractionRequiredAuthError.ts +8 -48
- package/src/error/JoseHeaderError.ts +1 -8
- package/src/exports-browser-only.ts +2 -6
- package/src/exports-common.ts +4 -34
- package/src/exports-node-only.ts +1 -4
- package/src/logger/Logger.ts +26 -39
- package/src/network/ThrottlingUtils.ts +12 -15
- package/src/packageMetadata.ts +1 -1
- package/src/protocol/Authorize.ts +24 -20
- package/src/request/AuthenticationHeaderParser.ts +2 -4
- package/src/request/BaseAuthRequest.ts +1 -7
- package/src/request/RequestParameterBuilder.ts +30 -45
- package/src/request/ScopeSet.ts +4 -4
- package/src/response/AuthenticationResult.ts +1 -1
- package/src/response/ResponseHandler.ts +53 -58
- package/src/telemetry/performance/IPerformanceClient.ts +0 -40
- package/src/telemetry/performance/PerformanceClient.ts +29 -266
- package/src/telemetry/performance/PerformanceEvent.ts +0 -582
- package/src/telemetry/performance/PerformanceEvents.ts +97 -0
- package/src/telemetry/performance/StubPerformanceClient.ts +0 -16
- package/src/telemetry/server/ServerTelemetryManager.ts +33 -44
- package/src/url/UrlString.ts +3 -12
- package/src/utils/Constants.ts +103 -146
- package/src/utils/FunctionWrappers.ts +28 -29
- package/src/utils/ProtocolUtils.ts +6 -6
- package/src/utils/UrlUtils.ts +2 -15
- package/dist/cache/entities/AccountEntity.mjs +0 -226
- package/dist/cache/entities/AccountEntity.mjs.map +0 -1
- package/dist/request/CommonClientCredentialRequest.d.ts +0 -18
- package/dist/request/CommonClientCredentialRequest.d.ts.map +0 -1
- package/dist/request/CommonDeviceCodeRequest.d.ts +0 -22
- package/dist/request/CommonDeviceCodeRequest.d.ts.map +0 -1
- package/dist/request/CommonOnBehalfOfRequest.d.ts +0 -14
- package/dist/request/CommonOnBehalfOfRequest.d.ts.map +0 -1
- package/dist/request/CommonUsernamePasswordRequest.d.ts +0 -18
- package/dist/request/CommonUsernamePasswordRequest.d.ts.map +0 -1
- package/lib/index-node-C8h2xZEM.js.map +0 -1
- package/lib/types/request/CommonClientCredentialRequest.d.ts +0 -18
- package/lib/types/request/CommonClientCredentialRequest.d.ts.map +0 -1
- package/lib/types/request/CommonDeviceCodeRequest.d.ts +0 -22
- package/lib/types/request/CommonDeviceCodeRequest.d.ts.map +0 -1
- package/lib/types/request/CommonOnBehalfOfRequest.d.ts +0 -14
- package/lib/types/request/CommonOnBehalfOfRequest.d.ts.map +0 -1
- package/lib/types/request/CommonUsernamePasswordRequest.d.ts +0 -18
- package/lib/types/request/CommonUsernamePasswordRequest.d.ts.map +0 -1
- package/src/request/CommonClientCredentialRequest.ts +0 -23
- package/src/request/CommonDeviceCodeRequest.ts +0 -31
- package/src/request/CommonOnBehalfOfRequest.ts +0 -19
- package/src/request/CommonUsernamePasswordRequest.ts +0 -23
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { Constants } from "../utils/Constants.js";
|
|
7
6
|
import { AuthError } from "./AuthError.js";
|
|
8
7
|
import * as InteractionRequiredAuthErrorCodes from "./InteractionRequiredAuthErrorCodes.js";
|
|
9
8
|
export { InteractionRequiredAuthErrorCodes };
|
|
@@ -26,46 +25,9 @@ export const InteractionRequiredAuthSubErrorMessage = [
|
|
|
26
25
|
"user_password_expired",
|
|
27
26
|
"consent_required",
|
|
28
27
|
"bad_token",
|
|
28
|
+
"ux_not_allowed",
|
|
29
29
|
];
|
|
30
30
|
|
|
31
|
-
const InteractionRequiredAuthErrorMessages = {
|
|
32
|
-
[InteractionRequiredAuthErrorCodes.noTokensFound]:
|
|
33
|
-
"No refresh token found in the cache. Please sign-in.",
|
|
34
|
-
[InteractionRequiredAuthErrorCodes.nativeAccountUnavailable]:
|
|
35
|
-
"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API.",
|
|
36
|
-
[InteractionRequiredAuthErrorCodes.refreshTokenExpired]:
|
|
37
|
-
"Refresh token has expired.",
|
|
38
|
-
[InteractionRequiredAuthErrorCodes.badToken]:
|
|
39
|
-
"Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve.",
|
|
40
|
-
[InteractionRequiredAuthErrorCodes.uxNotAllowed]:
|
|
41
|
-
"`canShowUI` flag in Edge was set to false. User interaction required on web page. Please invoke an interactive API to resolve.",
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Interaction required errors defined by the SDK
|
|
46
|
-
* @deprecated Use InteractionRequiredAuthErrorCodes instead
|
|
47
|
-
*/
|
|
48
|
-
export const InteractionRequiredAuthErrorMessage = {
|
|
49
|
-
noTokensFoundError: {
|
|
50
|
-
code: InteractionRequiredAuthErrorCodes.noTokensFound,
|
|
51
|
-
desc: InteractionRequiredAuthErrorMessages[
|
|
52
|
-
InteractionRequiredAuthErrorCodes.noTokensFound
|
|
53
|
-
],
|
|
54
|
-
},
|
|
55
|
-
native_account_unavailable: {
|
|
56
|
-
code: InteractionRequiredAuthErrorCodes.nativeAccountUnavailable,
|
|
57
|
-
desc: InteractionRequiredAuthErrorMessages[
|
|
58
|
-
InteractionRequiredAuthErrorCodes.nativeAccountUnavailable
|
|
59
|
-
],
|
|
60
|
-
},
|
|
61
|
-
bad_token: {
|
|
62
|
-
code: InteractionRequiredAuthErrorCodes.badToken,
|
|
63
|
-
desc: InteractionRequiredAuthErrorMessages[
|
|
64
|
-
InteractionRequiredAuthErrorCodes.badToken
|
|
65
|
-
],
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
|
|
69
31
|
/**
|
|
70
32
|
* Error thrown when user interaction is required.
|
|
71
33
|
*/
|
|
@@ -109,10 +71,10 @@ export class InteractionRequiredAuthError extends AuthError {
|
|
|
109
71
|
super(errorCode, errorMessage, subError);
|
|
110
72
|
Object.setPrototypeOf(this, InteractionRequiredAuthError.prototype);
|
|
111
73
|
|
|
112
|
-
this.timestamp = timestamp ||
|
|
113
|
-
this.traceId = traceId ||
|
|
114
|
-
this.correlationId = correlationId ||
|
|
115
|
-
this.claims = claims ||
|
|
74
|
+
this.timestamp = timestamp || "";
|
|
75
|
+
this.traceId = traceId || "";
|
|
76
|
+
this.correlationId = correlationId || "";
|
|
77
|
+
this.claims = claims || "";
|
|
116
78
|
this.name = "InteractionRequiredAuthError";
|
|
117
79
|
this.errorNo = errorNo;
|
|
118
80
|
}
|
|
@@ -152,10 +114,8 @@ export function isInteractionRequiredError(
|
|
|
152
114
|
* Creates an InteractionRequiredAuthError
|
|
153
115
|
*/
|
|
154
116
|
export function createInteractionRequiredAuthError(
|
|
155
|
-
errorCode: string
|
|
117
|
+
errorCode: string,
|
|
118
|
+
errorMessage?: string
|
|
156
119
|
): InteractionRequiredAuthError {
|
|
157
|
-
return new InteractionRequiredAuthError(
|
|
158
|
-
errorCode,
|
|
159
|
-
InteractionRequiredAuthErrorMessages[errorCode]
|
|
160
|
-
);
|
|
120
|
+
return new InteractionRequiredAuthError(errorCode, errorMessage);
|
|
161
121
|
}
|
|
@@ -7,13 +7,6 @@ import { AuthError } from "./AuthError.js";
|
|
|
7
7
|
import * as JoseHeaderErrorCodes from "./JoseHeaderErrorCodes.js";
|
|
8
8
|
export { JoseHeaderErrorCodes };
|
|
9
9
|
|
|
10
|
-
export const JoseHeaderErrorMessages = {
|
|
11
|
-
[JoseHeaderErrorCodes.missingKidError]:
|
|
12
|
-
"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided.",
|
|
13
|
-
[JoseHeaderErrorCodes.missingAlgError]:
|
|
14
|
-
"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided.",
|
|
15
|
-
};
|
|
16
|
-
|
|
17
10
|
/**
|
|
18
11
|
* Error thrown when there is an error in the client code running on the browser.
|
|
19
12
|
*/
|
|
@@ -28,5 +21,5 @@ export class JoseHeaderError extends AuthError {
|
|
|
28
21
|
|
|
29
22
|
/** Returns JoseHeaderError object */
|
|
30
23
|
export function createJoseHeaderError(code: string): JoseHeaderError {
|
|
31
|
-
return new JoseHeaderError(code
|
|
24
|
+
return new JoseHeaderError(code);
|
|
32
25
|
}
|
|
@@ -10,20 +10,16 @@ export {
|
|
|
10
10
|
IPerformanceClient,
|
|
11
11
|
PerformanceCallbackFunction,
|
|
12
12
|
InProgressPerformanceEvent,
|
|
13
|
-
QueueMeasurement,
|
|
14
13
|
} from "./telemetry/performance/IPerformanceClient.js";
|
|
15
14
|
export {
|
|
16
15
|
IntFields,
|
|
17
16
|
PerformanceEvent,
|
|
18
|
-
PerformanceEvents,
|
|
19
17
|
PerformanceEventStatus,
|
|
20
18
|
SubMeasurement,
|
|
21
19
|
} from "./telemetry/performance/PerformanceEvent.js";
|
|
20
|
+
export * as PerformanceEvents from "./telemetry/performance/PerformanceEvents.js";
|
|
22
21
|
export { IPerformanceMeasurement } from "./telemetry/performance/IPerformanceMeasurement.js";
|
|
23
|
-
export {
|
|
24
|
-
PerformanceClient,
|
|
25
|
-
PreQueueEvent,
|
|
26
|
-
} from "./telemetry/performance/PerformanceClient.js";
|
|
22
|
+
export { PerformanceClient } from "./telemetry/performance/PerformanceClient.js";
|
|
27
23
|
export { StubPerformanceClient } from "./telemetry/performance/StubPerformanceClient.js";
|
|
28
24
|
|
|
29
25
|
export { PopTokenGenerator } from "./crypto/PopTokenGenerator.js";
|
package/src/exports-common.ts
CHANGED
|
@@ -9,6 +9,7 @@ import * as CacheHelpers from "./cache/utils/CacheHelpers.js";
|
|
|
9
9
|
import * as TimeUtils from "./utils/TimeUtils.js";
|
|
10
10
|
import * as UrlUtils from "./utils/UrlUtils.js";
|
|
11
11
|
import * as AADServerParamKeys from "./constants/AADServerParamKeys.js";
|
|
12
|
+
import * as AccountEntityUtils from "./cache/utils/AccountEntityUtils.js";
|
|
12
13
|
|
|
13
14
|
export { AuthToken };
|
|
14
15
|
export { AuthorityFactory };
|
|
@@ -16,6 +17,7 @@ export { CacheHelpers };
|
|
|
16
17
|
export { TimeUtils };
|
|
17
18
|
export { UrlUtils };
|
|
18
19
|
export { AADServerParamKeys };
|
|
20
|
+
export { AccountEntityUtils };
|
|
19
21
|
|
|
20
22
|
export { AuthorizationCodeClient } from "./client/AuthorizationCodeClient.js";
|
|
21
23
|
export { RefreshTokenClient } from "./client/RefreshTokenClient.js";
|
|
@@ -25,7 +27,6 @@ export {
|
|
|
25
27
|
AuthOptions,
|
|
26
28
|
SystemOptions,
|
|
27
29
|
LoggerOptions,
|
|
28
|
-
CacheOptions,
|
|
29
30
|
DEFAULT_SYSTEM_OPTIONS,
|
|
30
31
|
AzureCloudOptions,
|
|
31
32
|
ApplicationTelemetry,
|
|
@@ -131,12 +132,10 @@ export { ILoggerCallback, LogLevel, Logger } from "./logger/Logger.js";
|
|
|
131
132
|
export {
|
|
132
133
|
InteractionRequiredAuthError,
|
|
133
134
|
InteractionRequiredAuthErrorCodes,
|
|
134
|
-
InteractionRequiredAuthErrorMessage,
|
|
135
135
|
createInteractionRequiredAuthError,
|
|
136
136
|
} from "./error/InteractionRequiredAuthError.js";
|
|
137
137
|
export {
|
|
138
138
|
AuthError,
|
|
139
|
-
AuthErrorMessage,
|
|
140
139
|
AuthErrorCodes,
|
|
141
140
|
createAuthError,
|
|
142
141
|
} from "./error/AuthError.js";
|
|
@@ -149,45 +148,16 @@ export {
|
|
|
149
148
|
} from "./error/CacheError.js";
|
|
150
149
|
export {
|
|
151
150
|
ClientAuthError,
|
|
152
|
-
ClientAuthErrorMessage,
|
|
153
151
|
ClientAuthErrorCodes,
|
|
154
152
|
createClientAuthError,
|
|
155
153
|
} from "./error/ClientAuthError.js";
|
|
156
154
|
export {
|
|
157
155
|
ClientConfigurationError,
|
|
158
|
-
ClientConfigurationErrorMessage,
|
|
159
156
|
ClientConfigurationErrorCodes,
|
|
160
157
|
createClientConfigurationError,
|
|
161
158
|
} from "./error/ClientConfigurationError.js";
|
|
162
|
-
export
|
|
163
|
-
|
|
164
|
-
OIDC_DEFAULT_SCOPES,
|
|
165
|
-
PromptValue,
|
|
166
|
-
PersistentCacheKeys,
|
|
167
|
-
OAuthResponseType,
|
|
168
|
-
ServerResponseType,
|
|
169
|
-
ResponseMode,
|
|
170
|
-
CacheOutcome,
|
|
171
|
-
CredentialType,
|
|
172
|
-
CacheType,
|
|
173
|
-
CacheAccountType,
|
|
174
|
-
AuthenticationScheme,
|
|
175
|
-
CodeChallengeMethodValues,
|
|
176
|
-
PasswordGrantConstants,
|
|
177
|
-
ThrottlingConstants,
|
|
178
|
-
ClaimsRequestKeys,
|
|
179
|
-
HeaderNames,
|
|
180
|
-
Errors,
|
|
181
|
-
THE_FAMILY_ID,
|
|
182
|
-
ONE_DAY_IN_MS,
|
|
183
|
-
GrantType,
|
|
184
|
-
AADAuthorityConstants,
|
|
185
|
-
HttpStatus,
|
|
186
|
-
HttpMethod,
|
|
187
|
-
DEFAULT_TOKEN_RENEWAL_OFFSET_SEC,
|
|
188
|
-
JsonWebTokenTypes,
|
|
189
|
-
EncodingTypes,
|
|
190
|
-
} from "./utils/Constants.js";
|
|
159
|
+
export * as Constants from "./utils/Constants.js";
|
|
160
|
+
|
|
191
161
|
export { StringUtils } from "./utils/StringUtils.js";
|
|
192
162
|
export { StringDict } from "./utils/MsalTypes.js";
|
|
193
163
|
export {
|
package/src/exports-node-only.ts
CHANGED
|
@@ -16,10 +16,6 @@ export { INativeBrokerPlugin } from "./broker/nativeBroker/INativeBrokerPlugin.j
|
|
|
16
16
|
export { ICachePlugin } from "./cache/interface/ICachePlugin.js";
|
|
17
17
|
export { TokenCacheContext } from "./cache/persistence/TokenCacheContext.js";
|
|
18
18
|
export { ISerializableTokenCache } from "./cache/interface/ISerializableTokenCache.js";
|
|
19
|
-
export { CommonClientCredentialRequest } from "./request/CommonClientCredentialRequest.js";
|
|
20
|
-
export { CommonOnBehalfOfRequest } from "./request/CommonOnBehalfOfRequest.js";
|
|
21
|
-
export { CommonDeviceCodeRequest } from "./request/CommonDeviceCodeRequest.js";
|
|
22
|
-
export { CommonUsernamePasswordRequest } from "./request/CommonUsernamePasswordRequest.js";
|
|
23
19
|
export { NativeRequest } from "./request/NativeRequest.js";
|
|
24
20
|
export { NativeSignOutRequest } from "./request/NativeSignOutRequest.js";
|
|
25
21
|
export {
|
|
@@ -33,3 +29,4 @@ export {
|
|
|
33
29
|
} from "./response/DeviceCodeResponse.js";
|
|
34
30
|
export { getClientAssertion } from "./utils/ClientAssertionUtils.js";
|
|
35
31
|
export { IGuidGenerator } from "./crypto/IGuidGenerator.js";
|
|
32
|
+
export { StubPerformanceClient } from "./telemetry/performance/StubPerformanceClient.js";
|
package/src/logger/Logger.ts
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { LoggerOptions } from "../config/ClientConfiguration.js";
|
|
7
|
-
import { Constants } from "../utils/Constants.js";
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* Options for logger messages.
|
|
@@ -13,7 +12,7 @@ export type LoggerMessageOptions = {
|
|
|
13
12
|
logLevel: LogLevel;
|
|
14
13
|
containsPii?: boolean;
|
|
15
14
|
context?: string;
|
|
16
|
-
correlationId
|
|
15
|
+
correlationId: string;
|
|
17
16
|
};
|
|
18
17
|
|
|
19
18
|
/**
|
|
@@ -38,9 +37,6 @@ export interface ILoggerCallback {
|
|
|
38
37
|
* Class which facilitates logging of messages to a specific place.
|
|
39
38
|
*/
|
|
40
39
|
export class Logger {
|
|
41
|
-
// Correlation ID for request, usually set by user.
|
|
42
|
-
private correlationId: string;
|
|
43
|
-
|
|
44
40
|
// Current log level, defaults to info.
|
|
45
41
|
private level: LogLevel = LogLevel.Info;
|
|
46
42
|
|
|
@@ -73,10 +69,8 @@ export class Logger {
|
|
|
73
69
|
typeof setLoggerOptions.logLevel === "number"
|
|
74
70
|
? setLoggerOptions.logLevel
|
|
75
71
|
: LogLevel.Info;
|
|
76
|
-
this.
|
|
77
|
-
|
|
78
|
-
this.packageName = packageName || Constants.EMPTY_STRING;
|
|
79
|
-
this.packageVersion = packageVersion || Constants.EMPTY_STRING;
|
|
72
|
+
this.packageName = packageName || "";
|
|
73
|
+
this.packageVersion = packageVersion || "";
|
|
80
74
|
}
|
|
81
75
|
|
|
82
76
|
private static createDefaultLoggerOptions(): LoggerOptions {
|
|
@@ -92,17 +86,12 @@ export class Logger {
|
|
|
92
86
|
/**
|
|
93
87
|
* Create new Logger with existing configurations.
|
|
94
88
|
*/
|
|
95
|
-
public clone(
|
|
96
|
-
packageName: string,
|
|
97
|
-
packageVersion: string,
|
|
98
|
-
correlationId?: string
|
|
99
|
-
): Logger {
|
|
89
|
+
public clone(packageName: string, packageVersion: string): Logger {
|
|
100
90
|
return new Logger(
|
|
101
91
|
{
|
|
102
92
|
loggerCallback: this.localCallback,
|
|
103
93
|
piiLoggingEnabled: this.piiLoggingEnabled,
|
|
104
94
|
logLevel: this.level,
|
|
105
|
-
correlationId: correlationId || this.correlationId,
|
|
106
95
|
},
|
|
107
96
|
packageName,
|
|
108
97
|
packageVersion
|
|
@@ -125,14 +114,12 @@ export class Logger {
|
|
|
125
114
|
const timestamp = new Date().toUTCString();
|
|
126
115
|
|
|
127
116
|
// Add correlationId to logs if set, correlationId provided on log messages take precedence
|
|
128
|
-
const logHeader = `[${timestamp}] : [${
|
|
129
|
-
options.correlationId || this.correlationId || ""
|
|
130
|
-
}]`;
|
|
117
|
+
const logHeader = `[${timestamp}] : [${options.correlationId}]`;
|
|
131
118
|
|
|
132
119
|
const log = `${logHeader} : ${this.packageName}@${
|
|
133
120
|
this.packageVersion
|
|
134
121
|
} : ${LogLevel[options.logLevel]} - ${logMessage}`;
|
|
135
|
-
// debug(`msal:${LogLevel[options.logLevel]}${options.containsPii ? "-Pii": Constants.
|
|
122
|
+
// debug(`msal:${LogLevel[options.logLevel]}${options.containsPii ? "-Pii": Constants.""}${options.context ? `:${options.context}` : Constants.""}`)(logMessage);
|
|
136
123
|
this.executeCallback(
|
|
137
124
|
options.logLevel,
|
|
138
125
|
log,
|
|
@@ -156,110 +143,110 @@ export class Logger {
|
|
|
156
143
|
/**
|
|
157
144
|
* Logs error messages.
|
|
158
145
|
*/
|
|
159
|
-
error(message: string, correlationId
|
|
146
|
+
error(message: string, correlationId: string): void {
|
|
160
147
|
this.logMessage(message, {
|
|
161
148
|
logLevel: LogLevel.Error,
|
|
162
149
|
containsPii: false,
|
|
163
|
-
correlationId: correlationId
|
|
150
|
+
correlationId: correlationId,
|
|
164
151
|
});
|
|
165
152
|
}
|
|
166
153
|
|
|
167
154
|
/**
|
|
168
155
|
* Logs error messages with PII.
|
|
169
156
|
*/
|
|
170
|
-
errorPii(message: string, correlationId
|
|
157
|
+
errorPii(message: string, correlationId: string): void {
|
|
171
158
|
this.logMessage(message, {
|
|
172
159
|
logLevel: LogLevel.Error,
|
|
173
160
|
containsPii: true,
|
|
174
|
-
correlationId: correlationId
|
|
161
|
+
correlationId: correlationId,
|
|
175
162
|
});
|
|
176
163
|
}
|
|
177
164
|
|
|
178
165
|
/**
|
|
179
166
|
* Logs warning messages.
|
|
180
167
|
*/
|
|
181
|
-
warning(message: string, correlationId
|
|
168
|
+
warning(message: string, correlationId: string): void {
|
|
182
169
|
this.logMessage(message, {
|
|
183
170
|
logLevel: LogLevel.Warning,
|
|
184
171
|
containsPii: false,
|
|
185
|
-
correlationId: correlationId
|
|
172
|
+
correlationId: correlationId,
|
|
186
173
|
});
|
|
187
174
|
}
|
|
188
175
|
|
|
189
176
|
/**
|
|
190
177
|
* Logs warning messages with PII.
|
|
191
178
|
*/
|
|
192
|
-
warningPii(message: string, correlationId
|
|
179
|
+
warningPii(message: string, correlationId: string): void {
|
|
193
180
|
this.logMessage(message, {
|
|
194
181
|
logLevel: LogLevel.Warning,
|
|
195
182
|
containsPii: true,
|
|
196
|
-
correlationId: correlationId
|
|
183
|
+
correlationId: correlationId,
|
|
197
184
|
});
|
|
198
185
|
}
|
|
199
186
|
|
|
200
187
|
/**
|
|
201
188
|
* Logs info messages.
|
|
202
189
|
*/
|
|
203
|
-
info(message: string, correlationId
|
|
190
|
+
info(message: string, correlationId: string): void {
|
|
204
191
|
this.logMessage(message, {
|
|
205
192
|
logLevel: LogLevel.Info,
|
|
206
193
|
containsPii: false,
|
|
207
|
-
correlationId: correlationId
|
|
194
|
+
correlationId: correlationId,
|
|
208
195
|
});
|
|
209
196
|
}
|
|
210
197
|
|
|
211
198
|
/**
|
|
212
199
|
* Logs info messages with PII.
|
|
213
200
|
*/
|
|
214
|
-
infoPii(message: string, correlationId
|
|
201
|
+
infoPii(message: string, correlationId: string): void {
|
|
215
202
|
this.logMessage(message, {
|
|
216
203
|
logLevel: LogLevel.Info,
|
|
217
204
|
containsPii: true,
|
|
218
|
-
correlationId: correlationId
|
|
205
|
+
correlationId: correlationId,
|
|
219
206
|
});
|
|
220
207
|
}
|
|
221
208
|
|
|
222
209
|
/**
|
|
223
210
|
* Logs verbose messages.
|
|
224
211
|
*/
|
|
225
|
-
verbose(message: string, correlationId
|
|
212
|
+
verbose(message: string, correlationId: string): void {
|
|
226
213
|
this.logMessage(message, {
|
|
227
214
|
logLevel: LogLevel.Verbose,
|
|
228
215
|
containsPii: false,
|
|
229
|
-
correlationId: correlationId
|
|
216
|
+
correlationId: correlationId,
|
|
230
217
|
});
|
|
231
218
|
}
|
|
232
219
|
|
|
233
220
|
/**
|
|
234
221
|
* Logs verbose messages with PII.
|
|
235
222
|
*/
|
|
236
|
-
verbosePii(message: string, correlationId
|
|
223
|
+
verbosePii(message: string, correlationId: string): void {
|
|
237
224
|
this.logMessage(message, {
|
|
238
225
|
logLevel: LogLevel.Verbose,
|
|
239
226
|
containsPii: true,
|
|
240
|
-
correlationId: correlationId
|
|
227
|
+
correlationId: correlationId,
|
|
241
228
|
});
|
|
242
229
|
}
|
|
243
230
|
|
|
244
231
|
/**
|
|
245
232
|
* Logs trace messages.
|
|
246
233
|
*/
|
|
247
|
-
trace(message: string, correlationId
|
|
234
|
+
trace(message: string, correlationId: string): void {
|
|
248
235
|
this.logMessage(message, {
|
|
249
236
|
logLevel: LogLevel.Trace,
|
|
250
237
|
containsPii: false,
|
|
251
|
-
correlationId: correlationId
|
|
238
|
+
correlationId: correlationId,
|
|
252
239
|
});
|
|
253
240
|
}
|
|
254
241
|
|
|
255
242
|
/**
|
|
256
243
|
* Logs trace messages with PII.
|
|
257
244
|
*/
|
|
258
|
-
tracePii(message: string, correlationId
|
|
245
|
+
tracePii(message: string, correlationId: string): void {
|
|
259
246
|
this.logMessage(message, {
|
|
260
247
|
logLevel: LogLevel.Trace,
|
|
261
248
|
containsPii: true,
|
|
262
|
-
correlationId: correlationId
|
|
249
|
+
correlationId: correlationId,
|
|
263
250
|
});
|
|
264
251
|
}
|
|
265
252
|
|
|
@@ -5,11 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { NetworkResponse } from "./NetworkResponse.js";
|
|
7
7
|
import { ServerAuthorizationTokenResponse } from "../response/ServerAuthorizationTokenResponse.js";
|
|
8
|
-
import
|
|
9
|
-
HeaderNames,
|
|
10
|
-
ThrottlingConstants,
|
|
11
|
-
Constants,
|
|
12
|
-
} from "../utils/Constants.js";
|
|
8
|
+
import * as Constants from "../utils/Constants.js";
|
|
13
9
|
import { CacheManager } from "../cache/CacheManager.js";
|
|
14
10
|
import { ServerError } from "../error/ServerError.js";
|
|
15
11
|
import {
|
|
@@ -26,9 +22,7 @@ export class ThrottlingUtils {
|
|
|
26
22
|
* @param thumbprint
|
|
27
23
|
*/
|
|
28
24
|
static generateThrottlingStorageKey(thumbprint: RequestThumbprint): string {
|
|
29
|
-
return `${
|
|
30
|
-
thumbprint
|
|
31
|
-
)}`;
|
|
25
|
+
return `${Constants.THROTTLING_PREFIX}.${JSON.stringify(thumbprint)}`;
|
|
32
26
|
}
|
|
33
27
|
|
|
34
28
|
/**
|
|
@@ -42,7 +36,7 @@ export class ThrottlingUtils {
|
|
|
42
36
|
correlationId: string
|
|
43
37
|
): void {
|
|
44
38
|
const key = ThrottlingUtils.generateThrottlingStorageKey(thumbprint);
|
|
45
|
-
const value = cacheManager.getThrottlingCache(key);
|
|
39
|
+
const value = cacheManager.getThrottlingCache(key, correlationId);
|
|
46
40
|
|
|
47
41
|
if (value) {
|
|
48
42
|
if (value.throttleTime < Date.now()) {
|
|
@@ -50,7 +44,7 @@ export class ThrottlingUtils {
|
|
|
50
44
|
return;
|
|
51
45
|
}
|
|
52
46
|
throw new ServerError(
|
|
53
|
-
value.errorCodes?.join(" ") ||
|
|
47
|
+
value.errorCodes?.join(" ") || "",
|
|
54
48
|
value.errorMessage,
|
|
55
49
|
value.subError
|
|
56
50
|
);
|
|
@@ -75,7 +69,9 @@ export class ThrottlingUtils {
|
|
|
75
69
|
) {
|
|
76
70
|
const thumbprintValue: ThrottlingEntity = {
|
|
77
71
|
throttleTime: ThrottlingUtils.calculateThrottleTime(
|
|
78
|
-
parseInt(
|
|
72
|
+
parseInt(
|
|
73
|
+
response.headers[Constants.HeaderNames.RETRY_AFTER]
|
|
74
|
+
)
|
|
79
75
|
),
|
|
80
76
|
error: response.body.error,
|
|
81
77
|
errorCodes: response.body.error_codes,
|
|
@@ -112,7 +108,9 @@ export class ThrottlingUtils {
|
|
|
112
108
|
): boolean {
|
|
113
109
|
if (response.headers) {
|
|
114
110
|
return (
|
|
115
|
-
response.headers.hasOwnProperty(
|
|
111
|
+
response.headers.hasOwnProperty(
|
|
112
|
+
Constants.HeaderNames.RETRY_AFTER
|
|
113
|
+
) &&
|
|
116
114
|
(response.status < 200 || response.status >= 300)
|
|
117
115
|
);
|
|
118
116
|
}
|
|
@@ -130,9 +128,8 @@ export class ThrottlingUtils {
|
|
|
130
128
|
return Math.floor(
|
|
131
129
|
Math.min(
|
|
132
130
|
currentSeconds +
|
|
133
|
-
(time ||
|
|
134
|
-
currentSeconds +
|
|
135
|
-
ThrottlingConstants.DEFAULT_MAX_THROTTLE_TIME_SECONDS
|
|
131
|
+
(time || Constants.DEFAULT_THROTTLE_TIME_SECONDS),
|
|
132
|
+
currentSeconds + Constants.DEFAULT_MAX_THROTTLE_TIME_SECONDS
|
|
136
133
|
) * 1000
|
|
137
134
|
);
|
|
138
135
|
}
|
package/src/packageMetadata.ts
CHANGED
|
@@ -26,7 +26,6 @@ import {
|
|
|
26
26
|
isInteractionRequiredError,
|
|
27
27
|
} from "../error/InteractionRequiredAuthError.js";
|
|
28
28
|
import { ServerError } from "../error/ServerError.js";
|
|
29
|
-
import { StringDict } from "../utils/MsalTypes.js";
|
|
30
29
|
|
|
31
30
|
/**
|
|
32
31
|
* Returns map of parameters that are applicable to all calls to /authorize whether using PKCE or EAR
|
|
@@ -94,7 +93,8 @@ export function getStandardAuthorizeRequestParameters(
|
|
|
94
93
|
if (request.sid && request.prompt === PromptValue.NONE) {
|
|
95
94
|
// SessionID is only used in silent calls
|
|
96
95
|
logger.verbose(
|
|
97
|
-
"createAuthCodeUrlQueryString: Prompt is none, adding sid from request"
|
|
96
|
+
"createAuthCodeUrlQueryString: Prompt is none, adding sid from request",
|
|
97
|
+
request.correlationId
|
|
98
98
|
);
|
|
99
99
|
RequestParameterBuilder.addSid(parameters, request.sid);
|
|
100
100
|
performanceClient?.addFields(
|
|
@@ -107,7 +107,8 @@ export function getStandardAuthorizeRequestParameters(
|
|
|
107
107
|
|
|
108
108
|
if (accountLoginHintClaim && request.domainHint) {
|
|
109
109
|
logger.warning(
|
|
110
|
-
`AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint
|
|
110
|
+
`AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint`,
|
|
111
|
+
request.correlationId
|
|
111
112
|
);
|
|
112
113
|
accountLoginHintClaim = null;
|
|
113
114
|
}
|
|
@@ -115,7 +116,8 @@ export function getStandardAuthorizeRequestParameters(
|
|
|
115
116
|
// If login_hint claim is present, use it over sid/username
|
|
116
117
|
if (accountLoginHintClaim) {
|
|
117
118
|
logger.verbose(
|
|
118
|
-
"createAuthCodeUrlQueryString: login_hint claim present on account"
|
|
119
|
+
"createAuthCodeUrlQueryString: login_hint claim present on account",
|
|
120
|
+
request.correlationId
|
|
119
121
|
);
|
|
120
122
|
RequestParameterBuilder.addLoginHint(
|
|
121
123
|
parameters,
|
|
@@ -132,7 +134,8 @@ export function getStandardAuthorizeRequestParameters(
|
|
|
132
134
|
RequestParameterBuilder.addCcsOid(parameters, clientInfo);
|
|
133
135
|
} catch (e) {
|
|
134
136
|
logger.verbose(
|
|
135
|
-
"createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header"
|
|
137
|
+
"createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",
|
|
138
|
+
request.correlationId
|
|
136
139
|
);
|
|
137
140
|
}
|
|
138
141
|
} else if (accountSid && request.prompt === PromptValue.NONE) {
|
|
@@ -141,7 +144,8 @@ export function getStandardAuthorizeRequestParameters(
|
|
|
141
144
|
* SessionId is only used in silent calls
|
|
142
145
|
*/
|
|
143
146
|
logger.verbose(
|
|
144
|
-
"createAuthCodeUrlQueryString: Prompt is none, adding sid from account"
|
|
147
|
+
"createAuthCodeUrlQueryString: Prompt is none, adding sid from account",
|
|
148
|
+
request.correlationId
|
|
145
149
|
);
|
|
146
150
|
RequestParameterBuilder.addSid(parameters, accountSid);
|
|
147
151
|
performanceClient?.addFields(
|
|
@@ -155,12 +159,14 @@ export function getStandardAuthorizeRequestParameters(
|
|
|
155
159
|
RequestParameterBuilder.addCcsOid(parameters, clientInfo);
|
|
156
160
|
} catch (e) {
|
|
157
161
|
logger.verbose(
|
|
158
|
-
"createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header"
|
|
162
|
+
"createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",
|
|
163
|
+
request.correlationId
|
|
159
164
|
);
|
|
160
165
|
}
|
|
161
166
|
} else if (request.loginHint) {
|
|
162
167
|
logger.verbose(
|
|
163
|
-
"createAuthCodeUrlQueryString: Adding login_hint from request"
|
|
168
|
+
"createAuthCodeUrlQueryString: Adding login_hint from request",
|
|
169
|
+
request.correlationId
|
|
164
170
|
);
|
|
165
171
|
RequestParameterBuilder.addLoginHint(
|
|
166
172
|
parameters,
|
|
@@ -177,7 +183,8 @@ export function getStandardAuthorizeRequestParameters(
|
|
|
177
183
|
} else if (request.account.username) {
|
|
178
184
|
// Fallback to account username if provided
|
|
179
185
|
logger.verbose(
|
|
180
|
-
"createAuthCodeUrlQueryString: Adding login_hint from account"
|
|
186
|
+
"createAuthCodeUrlQueryString: Adding login_hint from account",
|
|
187
|
+
request.correlationId
|
|
181
188
|
);
|
|
182
189
|
RequestParameterBuilder.addLoginHint(
|
|
183
190
|
parameters,
|
|
@@ -194,13 +201,15 @@ export function getStandardAuthorizeRequestParameters(
|
|
|
194
201
|
RequestParameterBuilder.addCcsOid(parameters, clientInfo);
|
|
195
202
|
} catch (e) {
|
|
196
203
|
logger.verbose(
|
|
197
|
-
"createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header"
|
|
204
|
+
"createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",
|
|
205
|
+
request.correlationId
|
|
198
206
|
);
|
|
199
207
|
}
|
|
200
208
|
}
|
|
201
209
|
} else if (request.loginHint) {
|
|
202
210
|
logger.verbose(
|
|
203
|
-
"createAuthCodeUrlQueryString: No account, adding login_hint from request"
|
|
211
|
+
"createAuthCodeUrlQueryString: No account, adding login_hint from request",
|
|
212
|
+
request.correlationId
|
|
204
213
|
);
|
|
205
214
|
RequestParameterBuilder.addLoginHint(parameters, request.loginHint);
|
|
206
215
|
RequestParameterBuilder.addCcsUpn(parameters, request.loginHint);
|
|
@@ -211,7 +220,8 @@ export function getStandardAuthorizeRequestParameters(
|
|
|
211
220
|
}
|
|
212
221
|
} else {
|
|
213
222
|
logger.verbose(
|
|
214
|
-
"createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints"
|
|
223
|
+
"createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints",
|
|
224
|
+
request.correlationId
|
|
215
225
|
);
|
|
216
226
|
}
|
|
217
227
|
|
|
@@ -265,15 +275,9 @@ export function getStandardAuthorizeRequestParameters(
|
|
|
265
275
|
*/
|
|
266
276
|
export function getAuthorizeUrl(
|
|
267
277
|
authority: Authority,
|
|
268
|
-
requestParameters: Map<string, string
|
|
269
|
-
encodeParams?: boolean,
|
|
270
|
-
extraQueryParameters?: StringDict | undefined
|
|
278
|
+
requestParameters: Map<string, string>
|
|
271
279
|
): string {
|
|
272
|
-
const queryString = mapToQueryString(
|
|
273
|
-
requestParameters,
|
|
274
|
-
encodeParams,
|
|
275
|
-
extraQueryParameters
|
|
276
|
-
);
|
|
280
|
+
const queryString = mapToQueryString(requestParameters);
|
|
277
281
|
return UrlString.appendQueryString(
|
|
278
282
|
authority.authorizationEndpoint,
|
|
279
283
|
queryString
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
createClientConfigurationError,
|
|
8
8
|
ClientConfigurationErrorCodes,
|
|
9
9
|
} from "../error/ClientConfigurationError.js";
|
|
10
|
-
import {
|
|
10
|
+
import { HeaderNames } from "../utils/Constants.js";
|
|
11
11
|
|
|
12
12
|
type WWWAuthenticateChallenges = {
|
|
13
13
|
nonce?: string;
|
|
@@ -82,9 +82,7 @@ export class AuthenticationHeaderParser {
|
|
|
82
82
|
challenges.forEach((challenge: string) => {
|
|
83
83
|
const [key, value] = challenge.split("=");
|
|
84
84
|
// Remove escaped quotation marks (', ") from challenge string to keep only the challenge value
|
|
85
|
-
challengeMap[key] = unescape(
|
|
86
|
-
value.replace(/['"]+/g, Constants.EMPTY_STRING)
|
|
87
|
-
);
|
|
85
|
+
challengeMap[key] = unescape(value.replace(/['"]+/g, ""));
|
|
88
86
|
});
|
|
89
87
|
|
|
90
88
|
return challengeMap;
|