@azure/msal-node 2.13.1 → 2.14.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/cache/ITokenCache.d.ts +1 -1
- package/dist/cache/ITokenCache.d.ts.map +1 -1
- package/dist/cache/NodeStorage.d.ts +1 -1
- package/dist/cache/NodeStorage.d.ts.map +1 -1
- package/dist/cache/NodeStorage.mjs +2 -2
- package/dist/cache/TokenCache.d.ts +1 -1
- package/dist/cache/TokenCache.d.ts.map +1 -1
- package/dist/cache/TokenCache.mjs +2 -2
- package/dist/cache/distributed/DistributedCachePlugin.d.ts +1 -1
- package/dist/cache/distributed/DistributedCachePlugin.d.ts.map +1 -1
- package/dist/cache/distributed/DistributedCachePlugin.mjs +2 -2
- package/dist/cache/distributed/IPartitionManager.d.ts +1 -1
- package/dist/cache/distributed/IPartitionManager.d.ts.map +1 -1
- package/dist/cache/serializer/Deserializer.d.ts +1 -1
- package/dist/cache/serializer/Deserializer.d.ts.map +1 -1
- package/dist/cache/serializer/Deserializer.mjs +2 -2
- package/dist/cache/serializer/Serializer.d.ts +1 -1
- package/dist/cache/serializer/Serializer.d.ts.map +1 -1
- package/dist/cache/serializer/Serializer.mjs +1 -1
- package/dist/cache/serializer/SerializerTypes.d.ts +1 -1
- package/dist/cache/serializer/SerializerTypes.d.ts.map +1 -1
- package/dist/client/ClientApplication.d.ts +1 -1
- package/dist/client/ClientApplication.d.ts.map +1 -1
- package/dist/client/ClientApplication.mjs +2 -2
- package/dist/client/ClientAssertion.mjs +2 -2
- package/dist/client/ClientCredentialClient.d.ts +2 -2
- package/dist/client/ClientCredentialClient.d.ts.map +1 -1
- package/dist/client/ClientCredentialClient.mjs +2 -2
- package/dist/client/ConfidentialClientApplication.d.ts +1 -1
- package/dist/client/ConfidentialClientApplication.d.ts.map +1 -1
- package/dist/client/ConfidentialClientApplication.mjs +2 -2
- package/dist/client/DeviceCodeClient.d.ts +1 -1
- package/dist/client/DeviceCodeClient.d.ts.map +1 -1
- package/dist/client/DeviceCodeClient.mjs +2 -2
- package/dist/client/IConfidentialClientApplication.d.ts +1 -1
- package/dist/client/IConfidentialClientApplication.d.ts.map +1 -1
- package/dist/client/IPublicClientApplication.d.ts +1 -1
- package/dist/client/IPublicClientApplication.d.ts.map +1 -1
- package/dist/client/ManagedIdentityApplication.d.ts +4 -4
- package/dist/client/ManagedIdentityApplication.d.ts.map +1 -1
- package/dist/client/ManagedIdentityApplication.mjs +2 -2
- package/dist/client/ManagedIdentityClient.d.ts +6 -6
- package/dist/client/ManagedIdentityClient.d.ts.map +1 -1
- package/dist/client/ManagedIdentityClient.mjs +1 -1
- package/dist/client/ManagedIdentitySources/AppService.d.ts +6 -6
- package/dist/client/ManagedIdentitySources/AppService.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/AppService.mjs +1 -1
- package/dist/client/ManagedIdentitySources/AzureArc.d.ts +7 -7
- package/dist/client/ManagedIdentitySources/AzureArc.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/AzureArc.mjs +2 -2
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts +8 -8
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +2 -2
- package/dist/client/ManagedIdentitySources/CloudShell.d.ts +6 -6
- package/dist/client/ManagedIdentitySources/CloudShell.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/CloudShell.mjs +1 -1
- package/dist/client/ManagedIdentitySources/Imds.d.ts +6 -6
- package/dist/client/ManagedIdentitySources/Imds.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/Imds.mjs +1 -1
- package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts +6 -6
- package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/ServiceFabric.mjs +1 -1
- package/dist/client/OnBehalfOfClient.d.ts +1 -1
- package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
- package/dist/client/OnBehalfOfClient.mjs +2 -2
- package/dist/client/PublicClientApplication.d.ts +1 -1
- package/dist/client/PublicClientApplication.d.ts.map +1 -1
- package/dist/client/PublicClientApplication.mjs +2 -2
- package/dist/client/UsernamePasswordClient.d.ts +1 -1
- package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
- package/dist/client/UsernamePasswordClient.mjs +2 -2
- package/dist/config/Configuration.d.ts +3 -3
- package/dist/config/Configuration.d.ts.map +1 -1
- package/dist/config/Configuration.mjs +2 -2
- package/dist/config/ManagedIdentityId.d.ts +2 -2
- package/dist/config/ManagedIdentityId.d.ts.map +1 -1
- package/dist/config/ManagedIdentityId.mjs +1 -1
- package/dist/config/ManagedIdentityRequestParameters.d.ts +1 -1
- package/dist/config/ManagedIdentityRequestParameters.d.ts.map +1 -1
- package/dist/config/ManagedIdentityRequestParameters.mjs +2 -2
- package/dist/crypto/CryptoProvider.d.ts +1 -1
- package/dist/crypto/CryptoProvider.d.ts.map +1 -1
- package/dist/crypto/CryptoProvider.mjs +1 -1
- package/dist/crypto/GuidGenerator.d.ts +1 -1
- package/dist/crypto/GuidGenerator.d.ts.map +1 -1
- package/dist/crypto/GuidGenerator.mjs +1 -1
- package/dist/crypto/HashUtils.d.ts +1 -1
- package/dist/crypto/HashUtils.mjs +1 -1
- package/dist/crypto/PkceGenerator.d.ts +1 -1
- package/dist/crypto/PkceGenerator.d.ts.map +1 -1
- package/dist/crypto/PkceGenerator.mjs +2 -2
- package/dist/error/ManagedIdentityError.d.ts +2 -2
- package/dist/error/ManagedIdentityError.d.ts.map +1 -1
- package/dist/error/ManagedIdentityError.mjs +2 -2
- package/dist/error/ManagedIdentityErrorCodes.mjs +1 -1
- package/dist/error/NodeAuthError.d.ts +1 -1
- package/dist/error/NodeAuthError.d.ts.map +1 -1
- package/dist/error/NodeAuthError.mjs +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/internals.mjs +1 -1
- package/dist/network/HttpClient.d.ts +3 -3
- package/dist/network/HttpClient.d.ts.map +1 -1
- package/dist/network/HttpClient.mjs +2 -2
- package/dist/network/HttpClientWithRetries.d.ts +2 -2
- package/dist/network/HttpClientWithRetries.d.ts.map +1 -1
- package/dist/network/HttpClientWithRetries.mjs +2 -2
- package/dist/network/ILoopbackClient.d.ts +1 -1
- package/dist/network/ILoopbackClient.d.ts.map +1 -1
- package/dist/network/LoopbackClient.d.ts +1 -1
- package/dist/network/LoopbackClient.d.ts.map +1 -1
- package/dist/network/LoopbackClient.mjs +2 -2
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/request/AuthorizationCodeRequest.d.ts +1 -1
- package/dist/request/AuthorizationCodeRequest.d.ts.map +1 -1
- package/dist/request/AuthorizationUrlRequest.d.ts +1 -1
- package/dist/request/AuthorizationUrlRequest.d.ts.map +1 -1
- package/dist/request/ClientCredentialRequest.d.ts +1 -1
- package/dist/request/ClientCredentialRequest.d.ts.map +1 -1
- package/dist/request/DeviceCodeRequest.d.ts +1 -1
- package/dist/request/DeviceCodeRequest.d.ts.map +1 -1
- package/dist/request/InteractiveRequest.d.ts +1 -1
- package/dist/request/ManagedIdentityRequest.d.ts +2 -2
- package/dist/request/ManagedIdentityRequest.d.ts.map +1 -1
- package/dist/request/OnBehalfOfRequest.d.ts +1 -1
- package/dist/request/OnBehalfOfRequest.d.ts.map +1 -1
- package/dist/request/RefreshTokenRequest.d.ts +1 -1
- package/dist/request/RefreshTokenRequest.d.ts.map +1 -1
- package/dist/request/SignOutRequest.d.ts +1 -1
- package/dist/request/SignOutRequest.d.ts.map +1 -1
- package/dist/request/SilentFlowRequest.d.ts +1 -1
- package/dist/request/SilentFlowRequest.d.ts.map +1 -1
- package/dist/request/UsernamePasswordRequest.d.ts +1 -1
- package/dist/request/UsernamePasswordRequest.d.ts.map +1 -1
- package/dist/response/ManagedIdentityTokenResponse.d.ts +1 -1
- package/dist/response/ManagedIdentityTokenResponse.d.ts.map +1 -1
- package/dist/retry/IHttpRetryPolicy.d.ts +1 -1
- package/dist/retry/LinearRetryPolicy.d.ts +2 -2
- package/dist/retry/LinearRetryPolicy.d.ts.map +1 -1
- package/dist/retry/LinearRetryPolicy.mjs +1 -1
- package/dist/utils/Constants.mjs +2 -2
- package/dist/utils/EncodingUtils.d.ts +1 -1
- package/dist/utils/EncodingUtils.mjs +2 -2
- package/dist/utils/NetworkUtils.d.ts +1 -1
- package/dist/utils/NetworkUtils.d.ts.map +1 -1
- package/dist/utils/NetworkUtils.mjs +1 -1
- package/dist/utils/NetworkUtils.mjs.map +1 -1
- package/lib/msal-node.cjs +12362 -0
- package/lib/msal-node.cjs.map +1 -0
- package/lib/package.json +1 -0
- package/lib/types/cache/ITokenCache.d.ts +16 -0
- package/lib/types/cache/ITokenCache.d.ts.map +1 -0
- package/lib/types/cache/NodeStorage.d.ts +194 -0
- package/lib/types/cache/NodeStorage.d.ts.map +1 -0
- package/lib/types/cache/TokenCache.d.ts +91 -0
- package/lib/types/cache/TokenCache.d.ts.map +1 -0
- package/lib/types/cache/distributed/DistributedCachePlugin.d.ts +11 -0
- package/lib/types/cache/distributed/DistributedCachePlugin.d.ts.map +1 -0
- package/lib/types/cache/distributed/ICacheClient.d.ts +18 -0
- package/lib/types/cache/distributed/ICacheClient.d.ts.map +1 -0
- package/lib/types/cache/distributed/IPartitionManager.d.ts +29 -0
- package/lib/types/cache/distributed/IPartitionManager.d.ts.map +1 -0
- package/lib/types/cache/serializer/Deserializer.d.ts +43 -0
- package/lib/types/cache/serializer/Deserializer.d.ts.map +1 -0
- package/lib/types/cache/serializer/Serializer.d.ts +40 -0
- package/lib/types/cache/serializer/Serializer.d.ts.map +1 -0
- package/lib/types/cache/serializer/SerializerTypes.d.ts +103 -0
- package/lib/types/cache/serializer/SerializerTypes.d.ts.map +1 -0
- package/lib/types/client/ClientApplication.d.ts +144 -0
- package/lib/types/client/ClientApplication.d.ts.map +1 -0
- package/lib/types/client/ClientAssertion.d.ts +56 -0
- package/lib/types/client/ClientAssertion.d.ts.map +1 -0
- package/lib/types/client/ClientCredentialClient.d.ts +34 -0
- package/lib/types/client/ClientCredentialClient.d.ts.map +1 -0
- package/lib/types/client/ConfidentialClientApplication.d.ts +59 -0
- package/lib/types/client/ConfidentialClientApplication.d.ts.map +1 -0
- package/lib/types/client/DeviceCodeClient.d.ts +54 -0
- package/lib/types/client/DeviceCodeClient.d.ts.map +1 -0
- package/lib/types/client/IConfidentialClientApplication.d.ts +40 -0
- package/lib/types/client/IConfidentialClientApplication.d.ts.map +1 -0
- package/lib/types/client/IPublicClientApplication.d.ts +43 -0
- package/lib/types/client/IPublicClientApplication.d.ts.map +1 -0
- package/lib/types/client/ManagedIdentityApplication.d.ts +31 -0
- package/lib/types/client/ManagedIdentityApplication.d.ts.map +1 -0
- package/lib/types/client/ManagedIdentityClient.d.ts +28 -0
- package/lib/types/client/ManagedIdentityClient.d.ts.map +1 -0
- package/lib/types/client/ManagedIdentitySources/AppService.d.ts +18 -0
- package/lib/types/client/ManagedIdentitySources/AppService.d.ts.map +1 -0
- package/lib/types/client/ManagedIdentitySources/AzureArc.d.ts +28 -0
- package/lib/types/client/ManagedIdentitySources/AzureArc.d.ts.map +1 -0
- package/lib/types/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts +31 -0
- package/lib/types/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -0
- package/lib/types/client/ManagedIdentitySources/CloudShell.d.ts +17 -0
- package/lib/types/client/ManagedIdentitySources/CloudShell.d.ts.map +1 -0
- package/lib/types/client/ManagedIdentitySources/Imds.d.ts +13 -0
- package/lib/types/client/ManagedIdentitySources/Imds.d.ts.map +1 -0
- package/lib/types/client/ManagedIdentitySources/ServiceFabric.d.ts +18 -0
- package/lib/types/client/ManagedIdentitySources/ServiceFabric.d.ts.map +1 -0
- package/lib/types/client/OnBehalfOfClient.d.ts +48 -0
- package/lib/types/client/OnBehalfOfClient.d.ts.map +1 -0
- package/lib/types/client/PublicClientApplication.d.ts +73 -0
- package/lib/types/client/PublicClientApplication.d.ts.map +1 -0
- package/lib/types/client/UsernamePasswordClient.d.ts +26 -0
- package/lib/types/client/UsernamePasswordClient.d.ts.map +1 -0
- package/lib/types/config/Configuration.d.ts +132 -0
- package/lib/types/config/Configuration.d.ts.map +1 -0
- package/lib/types/config/ManagedIdentityId.d.ts +12 -0
- package/lib/types/config/ManagedIdentityId.d.ts.map +1 -0
- package/lib/types/config/ManagedIdentityRequestParameters.d.ts +12 -0
- package/lib/types/config/ManagedIdentityRequestParameters.d.ts.map +1 -0
- package/lib/types/crypto/CryptoProvider.d.ts +63 -0
- package/lib/types/crypto/CryptoProvider.d.ts.map +1 -0
- package/lib/types/crypto/GuidGenerator.d.ts +15 -0
- package/lib/types/crypto/GuidGenerator.d.ts.map +1 -0
- package/lib/types/crypto/HashUtils.d.ts +9 -0
- package/lib/types/crypto/HashUtils.d.ts.map +1 -0
- package/lib/types/crypto/PkceGenerator.d.ts +23 -0
- package/lib/types/crypto/PkceGenerator.d.ts.map +1 -0
- package/lib/types/error/ManagedIdentityError.d.ts +31 -0
- package/lib/types/error/ManagedIdentityError.d.ts.map +1 -0
- package/lib/types/error/ManagedIdentityErrorCodes.d.ts +23 -0
- package/lib/types/error/ManagedIdentityErrorCodes.d.ts.map +1 -0
- package/lib/types/error/NodeAuthError.d.ts +74 -0
- package/lib/types/error/NodeAuthError.d.ts.map +1 -0
- package/lib/types/index.d.ts +46 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/internals.d.ts +7 -0
- package/lib/types/internals.d.ts.map +1 -0
- package/lib/types/network/HttpClient.d.ts +26 -0
- package/lib/types/network/HttpClient.d.ts.map +1 -0
- package/lib/types/network/HttpClientWithRetries.d.ts +12 -0
- package/lib/types/network/HttpClientWithRetries.d.ts.map +1 -0
- package/lib/types/network/ILoopbackClient.d.ts +11 -0
- package/lib/types/network/ILoopbackClient.d.ts.map +1 -0
- package/lib/types/network/LoopbackClient.d.ts +22 -0
- package/lib/types/network/LoopbackClient.d.ts.map +1 -0
- package/lib/types/packageMetadata.d.ts +3 -0
- package/lib/types/packageMetadata.d.ts.map +1 -0
- package/lib/types/request/AuthorizationCodeRequest.d.ts +22 -0
- package/lib/types/request/AuthorizationCodeRequest.d.ts.map +1 -0
- package/lib/types/request/AuthorizationUrlRequest.d.ts +34 -0
- package/lib/types/request/AuthorizationUrlRequest.d.ts.map +1 -0
- package/lib/types/request/ClientCredentialRequest.d.ts +15 -0
- package/lib/types/request/ClientCredentialRequest.d.ts.map +1 -0
- package/lib/types/request/DeviceCodeRequest.d.ts +16 -0
- package/lib/types/request/DeviceCodeRequest.d.ts.map +1 -0
- package/lib/types/request/InteractiveRequest.d.ts +23 -0
- package/lib/types/request/InteractiveRequest.d.ts.map +1 -0
- package/lib/types/request/ManagedIdentityRequest.d.ts +9 -0
- package/lib/types/request/ManagedIdentityRequest.d.ts.map +1 -0
- package/lib/types/request/ManagedIdentityRequestParams.d.ts +10 -0
- package/lib/types/request/ManagedIdentityRequestParams.d.ts.map +1 -0
- package/lib/types/request/OnBehalfOfRequest.d.ts +15 -0
- package/lib/types/request/OnBehalfOfRequest.d.ts.map +1 -0
- package/lib/types/request/RefreshTokenRequest.d.ts +18 -0
- package/lib/types/request/RefreshTokenRequest.d.ts.map +1 -0
- package/lib/types/request/SignOutRequest.d.ts +6 -0
- package/lib/types/request/SignOutRequest.d.ts.map +1 -0
- package/lib/types/request/SilentFlowRequest.d.ts +17 -0
- package/lib/types/request/SilentFlowRequest.d.ts.map +1 -0
- package/lib/types/request/UsernamePasswordRequest.d.ts +20 -0
- package/lib/types/request/UsernamePasswordRequest.d.ts.map +1 -0
- package/lib/types/response/ManagedIdentityTokenResponse.d.ts +35 -0
- package/lib/types/response/ManagedIdentityTokenResponse.d.ts.map +1 -0
- package/lib/types/retry/IHttpRetryPolicy.d.ts +6 -0
- package/lib/types/retry/IHttpRetryPolicy.d.ts.map +1 -0
- package/lib/types/retry/LinearRetryPolicy.d.ts +12 -0
- package/lib/types/retry/LinearRetryPolicy.d.ts.map +1 -0
- package/lib/types/utils/Constants.d.ts +142 -0
- package/lib/types/utils/Constants.d.ts.map +1 -0
- package/lib/types/utils/EncodingUtils.d.ts +27 -0
- package/lib/types/utils/EncodingUtils.d.ts.map +1 -0
- package/lib/types/utils/NetworkUtils.d.ts +6 -0
- package/lib/types/utils/NetworkUtils.d.ts.map +1 -0
- package/package.json +13 -10
- package/src/cache/ITokenCache.ts +1 -1
- package/src/cache/NodeStorage.ts +1 -1
- package/src/cache/TokenCache.ts +1 -1
- package/src/cache/distributed/DistributedCachePlugin.ts +1 -1
- package/src/cache/distributed/IPartitionManager.ts +1 -1
- package/src/cache/serializer/Deserializer.ts +1 -1
- package/src/cache/serializer/Serializer.ts +1 -1
- package/src/cache/serializer/SerializerTypes.ts +1 -1
- package/src/client/ClientApplication.ts +1 -1
- package/src/client/ClientAssertion.ts +1 -1
- package/src/client/ClientCredentialClient.ts +2 -2
- package/src/client/ConfidentialClientApplication.ts +1 -1
- package/src/client/DeviceCodeClient.ts +1 -1
- package/src/client/IConfidentialClientApplication.ts +1 -1
- package/src/client/IPublicClientApplication.ts +5 -1
- package/src/client/ManagedIdentityApplication.ts +9 -9
- package/src/client/ManagedIdentityClient.ts +13 -13
- package/src/client/ManagedIdentitySources/AppService.ts +7 -7
- package/src/client/ManagedIdentitySources/AzureArc.ts +9 -9
- package/src/client/ManagedIdentitySources/BaseManagedIdentitySource.ts +9 -9
- package/src/client/ManagedIdentitySources/CloudShell.ts +8 -8
- package/src/client/ManagedIdentitySources/Imds.ts +7 -7
- package/src/client/ManagedIdentitySources/ServiceFabric.ts +7 -7
- package/src/client/OnBehalfOfClient.ts +2 -2
- package/src/client/PublicClientApplication.ts +2 -2
- package/src/client/UsernamePasswordClient.ts +1 -1
- package/src/config/Configuration.ts +1 -1
- package/src/config/ManagedIdentityId.ts +3 -3
- package/src/config/ManagedIdentityRequestParameters.ts +2 -2
- package/src/crypto/CryptoProvider.ts +1 -1
- package/src/crypto/GuidGenerator.ts +1 -1
- package/src/crypto/PkceGenerator.ts +1 -1
- package/src/error/ManagedIdentityError.ts +3 -3
- package/src/error/ManagedIdentityErrorCodes.ts +1 -1
- package/src/error/NodeAuthError.ts +1 -1
- package/src/index.ts +1 -1
- package/src/network/HttpClient.ts +1 -1
- package/src/network/HttpClientWithRetries.ts +3 -3
- package/src/network/ILoopbackClient.ts +1 -1
- package/src/network/LoopbackClient.ts +1 -1
- package/src/packageMetadata.ts +1 -1
- package/src/request/AuthorizationCodeRequest.ts +1 -1
- package/src/request/AuthorizationUrlRequest.ts +1 -1
- package/src/request/ClientCredentialRequest.ts +1 -1
- package/src/request/DeviceCodeRequest.ts +1 -1
- package/src/request/ManagedIdentityRequest.ts +2 -2
- package/src/request/OnBehalfOfRequest.ts +1 -1
- package/src/request/RefreshTokenRequest.ts +1 -1
- package/src/request/SignOutRequest.ts +1 -1
- package/src/request/SilentFlowRequest.ts +1 -1
- package/src/request/UsernamePasswordRequest.ts +1 -1
- package/src/response/ManagedIdentityTokenResponse.ts +1 -1
- package/src/retry/LinearRetryPolicy.ts +1 -1
- package/src/utils/Constants.ts +1 -1
- package/src/utils/EncodingUtils.ts +1 -1
- package/src/utils/NetworkUtils.ts +4 -1
- package/dist/cache/NodeStorage.cjs +0 -434
- package/dist/cache/NodeStorage.cjs.map +0 -1
- package/dist/cache/TokenCache.cjs +0 -276
- package/dist/cache/TokenCache.cjs.map +0 -1
- package/dist/cache/distributed/DistributedCachePlugin.cjs +0 -35
- package/dist/cache/distributed/DistributedCachePlugin.cjs.map +0 -1
- package/dist/cache/serializer/Deserializer.cjs +0 -176
- package/dist/cache/serializer/Deserializer.cjs.map +0 -1
- package/dist/cache/serializer/Serializer.cjs +0 -144
- package/dist/cache/serializer/Serializer.cjs.map +0 -1
- package/dist/client/ClientApplication.cjs +0 -352
- package/dist/client/ClientApplication.cjs.map +0 -1
- package/dist/client/ClientAssertion.cjs +0 -155
- package/dist/client/ClientAssertion.cjs.map +0 -1
- package/dist/client/ClientCredentialClient.cjs +0 -203
- package/dist/client/ClientCredentialClient.cjs.map +0 -1
- package/dist/client/ConfidentialClientApplication.cjs +0 -183
- package/dist/client/ConfidentialClientApplication.cjs.map +0 -1
- package/dist/client/DeviceCodeClient.cjs +0 -216
- package/dist/client/DeviceCodeClient.cjs.map +0 -1
- package/dist/client/ManagedIdentityApplication.cjs +0 -100
- package/dist/client/ManagedIdentityApplication.cjs.map +0 -1
- package/dist/client/ManagedIdentityClient.cjs +0 -76
- package/dist/client/ManagedIdentityClient.cjs.map +0 -1
- package/dist/client/ManagedIdentitySources/AppService.cjs +0 -56
- package/dist/client/ManagedIdentitySources/AppService.cjs.map +0 -1
- package/dist/client/ManagedIdentitySources/AzureArc.cjs +0 -173
- package/dist/client/ManagedIdentitySources/AzureArc.cjs.map +0 -1
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.cjs +0 -135
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.cjs.map +0 -1
- package/dist/client/ManagedIdentitySources/CloudShell.cjs +0 -51
- package/dist/client/ManagedIdentitySources/CloudShell.cjs.map +0 -1
- package/dist/client/ManagedIdentitySources/Imds.cjs +0 -54
- package/dist/client/ManagedIdentitySources/Imds.cjs.map +0 -1
- package/dist/client/ManagedIdentitySources/ServiceFabric.cjs +0 -65
- package/dist/client/ManagedIdentitySources/ServiceFabric.cjs.map +0 -1
- package/dist/client/OnBehalfOfClient.cjs +0 -212
- package/dist/client/OnBehalfOfClient.cjs.map +0 -1
- package/dist/client/PublicClientApplication.cjs +0 -252
- package/dist/client/PublicClientApplication.cjs.map +0 -1
- package/dist/client/UsernamePasswordClient.cjs +0 -104
- package/dist/client/UsernamePasswordClient.cjs.map +0 -1
- package/dist/config/Configuration.cjs +0 -122
- package/dist/config/Configuration.cjs.map +0 -1
- package/dist/config/ManagedIdentityId.cjs +0 -59
- package/dist/config/ManagedIdentityId.cjs.map +0 -1
- package/dist/config/ManagedIdentityRequestParameters.cjs +0 -37
- package/dist/config/ManagedIdentityRequestParameters.cjs.map +0 -1
- package/dist/crypto/CryptoProvider.cjs +0 -101
- package/dist/crypto/CryptoProvider.cjs.map +0 -1
- package/dist/crypto/GuidGenerator.cjs +0 -31
- package/dist/crypto/GuidGenerator.cjs.map +0 -1
- package/dist/crypto/HashUtils.cjs +0 -23
- package/dist/crypto/HashUtils.cjs.map +0 -1
- package/dist/crypto/PkceGenerator.cjs +0 -62
- package/dist/crypto/PkceGenerator.cjs.map +0 -1
- package/dist/error/ManagedIdentityError.cjs +0 -54
- package/dist/error/ManagedIdentityError.cjs.map +0 -1
- package/dist/error/ManagedIdentityErrorCodes.cjs +0 -47
- package/dist/error/ManagedIdentityErrorCodes.cjs.map +0 -1
- package/dist/error/NodeAuthError.cjs +0 -105
- package/dist/error/NodeAuthError.cjs.map +0 -1
- package/dist/index.cjs +0 -123
- package/dist/index.cjs.map +0 -1
- package/dist/internals.cjs +0 -19
- package/dist/internals.cjs.map +0 -1
- package/dist/network/HttpClient.cjs +0 -294
- package/dist/network/HttpClient.cjs.map +0 -1
- package/dist/network/HttpClientWithRetries.cjs +0 -44
- package/dist/network/HttpClientWithRetries.cjs.map +0 -1
- package/dist/network/LoopbackClient.cjs +0 -93
- package/dist/network/LoopbackClient.cjs.map +0 -1
- package/dist/packageMetadata.cjs +0 -11
- package/dist/packageMetadata.cjs.map +0 -1
- package/dist/retry/LinearRetryPolicy.cjs +0 -47
- package/dist/retry/LinearRetryPolicy.cjs.map +0 -1
- package/dist/utils/Constants.cjs +0 -170
- package/dist/utils/Constants.cjs.map +0 -1
- package/dist/utils/EncodingUtils.cjs +0 -53
- package/dist/utils/EncodingUtils.cjs.map +0 -1
- package/dist/utils/NetworkUtils.cjs +0 -45
- package/dist/utils/NetworkUtils.cjs.map +0 -1
|
@@ -1,352 +0,0 @@
|
|
|
1
|
-
/*! @azure/msal-node v2.13.1 2024-08-29 */
|
|
2
|
-
'use strict';
|
|
3
|
-
'use strict';
|
|
4
|
-
|
|
5
|
-
var msalCommon = require('@azure/msal-common');
|
|
6
|
-
var Configuration = require('../config/Configuration.cjs');
|
|
7
|
-
var CryptoProvider = require('../crypto/CryptoProvider.cjs');
|
|
8
|
-
var NodeStorage = require('../cache/NodeStorage.cjs');
|
|
9
|
-
var Constants = require('../utils/Constants.cjs');
|
|
10
|
-
var TokenCache = require('../cache/TokenCache.cjs');
|
|
11
|
-
var ClientAssertion = require('./ClientAssertion.cjs');
|
|
12
|
-
var packageMetadata = require('../packageMetadata.cjs');
|
|
13
|
-
var NodeAuthError = require('../error/NodeAuthError.cjs');
|
|
14
|
-
var UsernamePasswordClient = require('./UsernamePasswordClient.cjs');
|
|
15
|
-
|
|
16
|
-
/*
|
|
17
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
18
|
-
* Licensed under the MIT License.
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* Base abstract class for all ClientApplications - public and confidential
|
|
22
|
-
* @public
|
|
23
|
-
*/
|
|
24
|
-
class ClientApplication {
|
|
25
|
-
/**
|
|
26
|
-
* Constructor for the ClientApplication
|
|
27
|
-
*/
|
|
28
|
-
constructor(configuration) {
|
|
29
|
-
this.config = Configuration.buildAppConfiguration(configuration);
|
|
30
|
-
this.cryptoProvider = new CryptoProvider.CryptoProvider();
|
|
31
|
-
this.logger = new msalCommon.Logger(this.config.system.loggerOptions, packageMetadata.name, packageMetadata.version);
|
|
32
|
-
this.storage = new NodeStorage.NodeStorage(this.logger, this.config.auth.clientId, this.cryptoProvider, msalCommon.buildStaticAuthorityOptions(this.config.auth));
|
|
33
|
-
this.tokenCache = new TokenCache.TokenCache(this.storage, this.logger, this.config.cache.cachePlugin);
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Creates the URL of the authorization request, letting the user input credentials and consent to the
|
|
37
|
-
* application. The URL targets the /authorize endpoint of the authority configured in the
|
|
38
|
-
* application object.
|
|
39
|
-
*
|
|
40
|
-
* Once the user inputs their credentials and consents, the authority will send a response to the redirect URI
|
|
41
|
-
* sent in the request and should contain an authorization code, which can then be used to acquire tokens via
|
|
42
|
-
* `acquireTokenByCode(AuthorizationCodeRequest)`.
|
|
43
|
-
*/
|
|
44
|
-
async getAuthCodeUrl(request) {
|
|
45
|
-
this.logger.info("getAuthCodeUrl called", request.correlationId);
|
|
46
|
-
const validRequest = {
|
|
47
|
-
...request,
|
|
48
|
-
...(await this.initializeBaseRequest(request)),
|
|
49
|
-
responseMode: request.responseMode || msalCommon.ResponseMode.QUERY,
|
|
50
|
-
authenticationScheme: msalCommon.AuthenticationScheme.BEARER,
|
|
51
|
-
};
|
|
52
|
-
const authClientConfig = await this.buildOauthClientConfiguration(validRequest.authority, validRequest.correlationId, undefined, undefined, request.azureCloudOptions);
|
|
53
|
-
const authorizationCodeClient = new msalCommon.AuthorizationCodeClient(authClientConfig);
|
|
54
|
-
this.logger.verbose("Auth code client created", validRequest.correlationId);
|
|
55
|
-
return authorizationCodeClient.getAuthCodeUrl(validRequest);
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Acquires a token by exchanging the Authorization Code received from the first step of OAuth2.0
|
|
59
|
-
* Authorization Code flow.
|
|
60
|
-
*
|
|
61
|
-
* `getAuthCodeUrl(AuthorizationCodeUrlRequest)` can be used to create the URL for the first step of OAuth2.0
|
|
62
|
-
* Authorization Code flow. Ensure that values for redirectUri and scopes in AuthorizationCodeUrlRequest and
|
|
63
|
-
* AuthorizationCodeRequest are the same.
|
|
64
|
-
*/
|
|
65
|
-
async acquireTokenByCode(request, authCodePayLoad) {
|
|
66
|
-
this.logger.info("acquireTokenByCode called");
|
|
67
|
-
if (request.state && authCodePayLoad) {
|
|
68
|
-
this.logger.info("acquireTokenByCode - validating state");
|
|
69
|
-
this.validateState(request.state, authCodePayLoad.state || "");
|
|
70
|
-
// eslint-disable-next-line no-param-reassign
|
|
71
|
-
authCodePayLoad = { ...authCodePayLoad, state: "" };
|
|
72
|
-
}
|
|
73
|
-
const validRequest = {
|
|
74
|
-
...request,
|
|
75
|
-
...(await this.initializeBaseRequest(request)),
|
|
76
|
-
authenticationScheme: msalCommon.AuthenticationScheme.BEARER,
|
|
77
|
-
};
|
|
78
|
-
const serverTelemetryManager = this.initializeServerTelemetryManager(Constants.ApiId.acquireTokenByCode, validRequest.correlationId);
|
|
79
|
-
try {
|
|
80
|
-
const authClientConfig = await this.buildOauthClientConfiguration(validRequest.authority, validRequest.correlationId, serverTelemetryManager, undefined, request.azureCloudOptions);
|
|
81
|
-
const authorizationCodeClient = new msalCommon.AuthorizationCodeClient(authClientConfig);
|
|
82
|
-
this.logger.verbose("Auth code client created", validRequest.correlationId);
|
|
83
|
-
return await authorizationCodeClient.acquireToken(validRequest, authCodePayLoad);
|
|
84
|
-
}
|
|
85
|
-
catch (e) {
|
|
86
|
-
if (e instanceof msalCommon.AuthError) {
|
|
87
|
-
e.setCorrelationId(validRequest.correlationId);
|
|
88
|
-
}
|
|
89
|
-
serverTelemetryManager.cacheFailedRequest(e);
|
|
90
|
-
throw e;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Acquires a token by exchanging the refresh token provided for a new set of tokens.
|
|
95
|
-
*
|
|
96
|
-
* This API is provided only for scenarios where you would like to migrate from ADAL to MSAL. Otherwise, it is
|
|
97
|
-
* recommended that you use `acquireTokenSilent()` for silent scenarios. When using `acquireTokenSilent()`, MSAL will
|
|
98
|
-
* handle the caching and refreshing of tokens automatically.
|
|
99
|
-
*/
|
|
100
|
-
async acquireTokenByRefreshToken(request) {
|
|
101
|
-
this.logger.info("acquireTokenByRefreshToken called", request.correlationId);
|
|
102
|
-
const validRequest = {
|
|
103
|
-
...request,
|
|
104
|
-
...(await this.initializeBaseRequest(request)),
|
|
105
|
-
authenticationScheme: msalCommon.AuthenticationScheme.BEARER,
|
|
106
|
-
};
|
|
107
|
-
const serverTelemetryManager = this.initializeServerTelemetryManager(Constants.ApiId.acquireTokenByRefreshToken, validRequest.correlationId);
|
|
108
|
-
try {
|
|
109
|
-
const refreshTokenClientConfig = await this.buildOauthClientConfiguration(validRequest.authority, validRequest.correlationId, serverTelemetryManager, undefined, request.azureCloudOptions);
|
|
110
|
-
const refreshTokenClient = new msalCommon.RefreshTokenClient(refreshTokenClientConfig);
|
|
111
|
-
this.logger.verbose("Refresh token client created", validRequest.correlationId);
|
|
112
|
-
return await refreshTokenClient.acquireToken(validRequest);
|
|
113
|
-
}
|
|
114
|
-
catch (e) {
|
|
115
|
-
if (e instanceof msalCommon.AuthError) {
|
|
116
|
-
e.setCorrelationId(validRequest.correlationId);
|
|
117
|
-
}
|
|
118
|
-
serverTelemetryManager.cacheFailedRequest(e);
|
|
119
|
-
throw e;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Acquires a token silently when a user specifies the account the token is requested for.
|
|
124
|
-
*
|
|
125
|
-
* This API expects the user to provide an account object and looks into the cache to retrieve the token if present.
|
|
126
|
-
* There is also an optional "forceRefresh" boolean the user can send to bypass the cache for access_token and id_token.
|
|
127
|
-
* In case the refresh_token is expired or not found, an error is thrown
|
|
128
|
-
* and the guidance is for the user to call any interactive token acquisition API (eg: `acquireTokenByCode()`).
|
|
129
|
-
*/
|
|
130
|
-
async acquireTokenSilent(request) {
|
|
131
|
-
const validRequest = {
|
|
132
|
-
...request,
|
|
133
|
-
...(await this.initializeBaseRequest(request)),
|
|
134
|
-
forceRefresh: request.forceRefresh || false,
|
|
135
|
-
};
|
|
136
|
-
const serverTelemetryManager = this.initializeServerTelemetryManager(Constants.ApiId.acquireTokenSilent, validRequest.correlationId, validRequest.forceRefresh);
|
|
137
|
-
try {
|
|
138
|
-
const silentFlowClientConfig = await this.buildOauthClientConfiguration(validRequest.authority, validRequest.correlationId, serverTelemetryManager, undefined, request.azureCloudOptions);
|
|
139
|
-
const silentFlowClient = new msalCommon.SilentFlowClient(silentFlowClientConfig);
|
|
140
|
-
this.logger.verbose("Silent flow client created", validRequest.correlationId);
|
|
141
|
-
return await silentFlowClient.acquireToken(validRequest);
|
|
142
|
-
}
|
|
143
|
-
catch (e) {
|
|
144
|
-
if (e instanceof msalCommon.AuthError) {
|
|
145
|
-
e.setCorrelationId(validRequest.correlationId);
|
|
146
|
-
}
|
|
147
|
-
serverTelemetryManager.cacheFailedRequest(e);
|
|
148
|
-
throw e;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Acquires tokens with password grant by exchanging client applications username and password for credentials
|
|
153
|
-
*
|
|
154
|
-
* The latest OAuth 2.0 Security Best Current Practice disallows the password grant entirely.
|
|
155
|
-
* More details on this recommendation at https://tools.ietf.org/html/draft-ietf-oauth-security-topics-13#section-3.4
|
|
156
|
-
* Microsoft's documentation and recommendations are at:
|
|
157
|
-
* https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-authentication-flows#usernamepassword
|
|
158
|
-
*
|
|
159
|
-
* @param request - UsenamePasswordRequest
|
|
160
|
-
*/
|
|
161
|
-
async acquireTokenByUsernamePassword(request) {
|
|
162
|
-
this.logger.info("acquireTokenByUsernamePassword called", request.correlationId);
|
|
163
|
-
const validRequest = {
|
|
164
|
-
...request,
|
|
165
|
-
...(await this.initializeBaseRequest(request)),
|
|
166
|
-
};
|
|
167
|
-
const serverTelemetryManager = this.initializeServerTelemetryManager(Constants.ApiId.acquireTokenByUsernamePassword, validRequest.correlationId);
|
|
168
|
-
try {
|
|
169
|
-
const usernamePasswordClientConfig = await this.buildOauthClientConfiguration(validRequest.authority, validRequest.correlationId, serverTelemetryManager, undefined, request.azureCloudOptions);
|
|
170
|
-
const usernamePasswordClient = new UsernamePasswordClient.UsernamePasswordClient(usernamePasswordClientConfig);
|
|
171
|
-
this.logger.verbose("Username password client created", validRequest.correlationId);
|
|
172
|
-
return await usernamePasswordClient.acquireToken(validRequest);
|
|
173
|
-
}
|
|
174
|
-
catch (e) {
|
|
175
|
-
if (e instanceof msalCommon.AuthError) {
|
|
176
|
-
e.setCorrelationId(validRequest.correlationId);
|
|
177
|
-
}
|
|
178
|
-
serverTelemetryManager.cacheFailedRequest(e);
|
|
179
|
-
throw e;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Gets the token cache for the application.
|
|
184
|
-
*/
|
|
185
|
-
getTokenCache() {
|
|
186
|
-
this.logger.info("getTokenCache called");
|
|
187
|
-
return this.tokenCache;
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Validates OIDC state by comparing the user cached state with the state received from the server.
|
|
191
|
-
*
|
|
192
|
-
* This API is provided for scenarios where you would use OAuth2.0 state parameter to mitigate against
|
|
193
|
-
* CSRF attacks.
|
|
194
|
-
* For more information about state, visit https://datatracker.ietf.org/doc/html/rfc6819#section-3.6.
|
|
195
|
-
* @param state
|
|
196
|
-
* @param cachedState
|
|
197
|
-
*/
|
|
198
|
-
validateState(state, cachedState) {
|
|
199
|
-
if (!state) {
|
|
200
|
-
throw NodeAuthError.NodeAuthError.createStateNotFoundError();
|
|
201
|
-
}
|
|
202
|
-
if (state !== cachedState) {
|
|
203
|
-
throw msalCommon.createClientAuthError(msalCommon.ClientAuthErrorCodes.stateMismatch);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* Returns the logger instance
|
|
208
|
-
*/
|
|
209
|
-
getLogger() {
|
|
210
|
-
return this.logger;
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
* Replaces the default logger set in configurations with new Logger with new configurations
|
|
214
|
-
* @param logger - Logger instance
|
|
215
|
-
*/
|
|
216
|
-
setLogger(logger) {
|
|
217
|
-
this.logger = logger;
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* Builds the common configuration to be passed to the common component based on the platform configurarion
|
|
221
|
-
* @param authority - user passed authority in configuration
|
|
222
|
-
* @param serverTelemetryManager - initializes servertelemetry if passed
|
|
223
|
-
*/
|
|
224
|
-
async buildOauthClientConfiguration(authority, requestCorrelationId, serverTelemetryManager, azureRegionConfiguration, azureCloudOptions) {
|
|
225
|
-
this.logger.verbose("buildOauthClientConfiguration called", requestCorrelationId);
|
|
226
|
-
// precedence - azureCloudInstance + tenant >> authority and request >> config
|
|
227
|
-
const userAzureCloudOptions = azureCloudOptions
|
|
228
|
-
? azureCloudOptions
|
|
229
|
-
: this.config.auth.azureCloudOptions;
|
|
230
|
-
// using null assertion operator as we ensure that all config values have default values in buildConfiguration()
|
|
231
|
-
const discoveredAuthority = await this.createAuthority(authority, requestCorrelationId, azureRegionConfiguration, userAzureCloudOptions);
|
|
232
|
-
this.logger.info(`Building oauth client configuration with the following authority: ${discoveredAuthority.tokenEndpoint}.`, requestCorrelationId);
|
|
233
|
-
serverTelemetryManager?.updateRegionDiscoveryMetadata(discoveredAuthority.regionDiscoveryMetadata);
|
|
234
|
-
const clientConfiguration = {
|
|
235
|
-
authOptions: {
|
|
236
|
-
clientId: this.config.auth.clientId,
|
|
237
|
-
authority: discoveredAuthority,
|
|
238
|
-
clientCapabilities: this.config.auth.clientCapabilities,
|
|
239
|
-
},
|
|
240
|
-
loggerOptions: {
|
|
241
|
-
logLevel: this.config.system.loggerOptions.logLevel,
|
|
242
|
-
loggerCallback: this.config.system.loggerOptions.loggerCallback,
|
|
243
|
-
piiLoggingEnabled: this.config.system.loggerOptions.piiLoggingEnabled,
|
|
244
|
-
correlationId: requestCorrelationId,
|
|
245
|
-
},
|
|
246
|
-
cacheOptions: {
|
|
247
|
-
claimsBasedCachingEnabled: this.config.cache.claimsBasedCachingEnabled,
|
|
248
|
-
},
|
|
249
|
-
cryptoInterface: this.cryptoProvider,
|
|
250
|
-
networkInterface: this.config.system.networkClient,
|
|
251
|
-
storageInterface: this.storage,
|
|
252
|
-
serverTelemetryManager: serverTelemetryManager,
|
|
253
|
-
clientCredentials: {
|
|
254
|
-
clientSecret: this.clientSecret,
|
|
255
|
-
clientAssertion: await this.getClientAssertion(discoveredAuthority),
|
|
256
|
-
},
|
|
257
|
-
libraryInfo: {
|
|
258
|
-
sku: Constants.Constants.MSAL_SKU,
|
|
259
|
-
version: packageMetadata.version,
|
|
260
|
-
cpu: process.arch || msalCommon.Constants.EMPTY_STRING,
|
|
261
|
-
os: process.platform || msalCommon.Constants.EMPTY_STRING,
|
|
262
|
-
},
|
|
263
|
-
telemetry: this.config.telemetry,
|
|
264
|
-
persistencePlugin: this.config.cache.cachePlugin,
|
|
265
|
-
serializableCache: this.tokenCache,
|
|
266
|
-
};
|
|
267
|
-
return clientConfiguration;
|
|
268
|
-
}
|
|
269
|
-
async getClientAssertion(authority) {
|
|
270
|
-
if (this.developerProvidedClientAssertion) {
|
|
271
|
-
this.clientAssertion = ClientAssertion.ClientAssertion.fromAssertion(await msalCommon.getClientAssertion(this.developerProvidedClientAssertion, this.config.auth.clientId, authority.tokenEndpoint));
|
|
272
|
-
}
|
|
273
|
-
return (this.clientAssertion && {
|
|
274
|
-
assertion: this.clientAssertion.getJwt(this.cryptoProvider, this.config.auth.clientId, authority.tokenEndpoint),
|
|
275
|
-
assertionType: Constants.Constants.JWT_BEARER_ASSERTION_TYPE,
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
/**
|
|
279
|
-
* Generates a request with the default scopes & generates a correlationId.
|
|
280
|
-
* @param authRequest - BaseAuthRequest for initialization
|
|
281
|
-
*/
|
|
282
|
-
async initializeBaseRequest(authRequest) {
|
|
283
|
-
this.logger.verbose("initializeRequestScopes called", authRequest.correlationId);
|
|
284
|
-
// Default authenticationScheme to Bearer, log that POP isn't supported yet
|
|
285
|
-
if (authRequest.authenticationScheme &&
|
|
286
|
-
authRequest.authenticationScheme === msalCommon.AuthenticationScheme.POP) {
|
|
287
|
-
this.logger.verbose("Authentication Scheme 'pop' is not supported yet, setting Authentication Scheme to 'Bearer' for request", authRequest.correlationId);
|
|
288
|
-
}
|
|
289
|
-
authRequest.authenticationScheme = msalCommon.AuthenticationScheme.BEARER;
|
|
290
|
-
// Set requested claims hash if claims-based caching is enabled and claims were requested
|
|
291
|
-
if (this.config.cache.claimsBasedCachingEnabled &&
|
|
292
|
-
authRequest.claims &&
|
|
293
|
-
// Checks for empty stringified object "{}" which doesn't qualify as requested claims
|
|
294
|
-
!msalCommon.StringUtils.isEmptyObj(authRequest.claims)) {
|
|
295
|
-
authRequest.requestedClaimsHash =
|
|
296
|
-
await this.cryptoProvider.hashString(authRequest.claims);
|
|
297
|
-
}
|
|
298
|
-
return {
|
|
299
|
-
...authRequest,
|
|
300
|
-
scopes: [
|
|
301
|
-
...((authRequest && authRequest.scopes) || []),
|
|
302
|
-
...msalCommon.OIDC_DEFAULT_SCOPES,
|
|
303
|
-
],
|
|
304
|
-
correlationId: (authRequest && authRequest.correlationId) ||
|
|
305
|
-
this.cryptoProvider.createNewGuid(),
|
|
306
|
-
authority: authRequest.authority || this.config.auth.authority,
|
|
307
|
-
};
|
|
308
|
-
}
|
|
309
|
-
/**
|
|
310
|
-
* Initializes the server telemetry payload
|
|
311
|
-
* @param apiId - Id for a specific request
|
|
312
|
-
* @param correlationId - GUID
|
|
313
|
-
* @param forceRefresh - boolean to indicate network call
|
|
314
|
-
*/
|
|
315
|
-
initializeServerTelemetryManager(apiId, correlationId, forceRefresh) {
|
|
316
|
-
const telemetryPayload = {
|
|
317
|
-
clientId: this.config.auth.clientId,
|
|
318
|
-
correlationId: correlationId,
|
|
319
|
-
apiId: apiId,
|
|
320
|
-
forceRefresh: forceRefresh || false,
|
|
321
|
-
};
|
|
322
|
-
return new msalCommon.ServerTelemetryManager(telemetryPayload, this.storage);
|
|
323
|
-
}
|
|
324
|
-
/**
|
|
325
|
-
* Create authority instance. If authority not passed in request, default to authority set on the application
|
|
326
|
-
* object. If no authority set in application object, then default to common authority.
|
|
327
|
-
* @param authorityString - authority from user configuration
|
|
328
|
-
*/
|
|
329
|
-
async createAuthority(authorityString, requestCorrelationId, azureRegionConfiguration, azureCloudOptions) {
|
|
330
|
-
this.logger.verbose("createAuthority called", requestCorrelationId);
|
|
331
|
-
// build authority string based on auth params - azureCloudInstance is prioritized if provided
|
|
332
|
-
const authorityUrl = msalCommon.Authority.generateAuthority(authorityString, azureCloudOptions);
|
|
333
|
-
const authorityOptions = {
|
|
334
|
-
protocolMode: this.config.auth.protocolMode,
|
|
335
|
-
knownAuthorities: this.config.auth.knownAuthorities,
|
|
336
|
-
cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,
|
|
337
|
-
authorityMetadata: this.config.auth.authorityMetadata,
|
|
338
|
-
azureRegionConfiguration,
|
|
339
|
-
skipAuthorityMetadataCache: this.config.auth.skipAuthorityMetadataCache,
|
|
340
|
-
};
|
|
341
|
-
return msalCommon.AuthorityFactory.createDiscoveredInstance(authorityUrl, this.config.system.networkClient, this.storage, authorityOptions, this.logger, requestCorrelationId);
|
|
342
|
-
}
|
|
343
|
-
/**
|
|
344
|
-
* Clear the cache
|
|
345
|
-
*/
|
|
346
|
-
clearCache() {
|
|
347
|
-
void this.storage.clear();
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
exports.ClientApplication = ClientApplication;
|
|
352
|
-
//# sourceMappingURL=ClientApplication.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ClientApplication.cjs","sources":["../../src/client/ClientApplication.ts"],"sourcesContent":[null],"names":["buildAppConfiguration","CryptoProvider","Logger","name","version","NodeStorage","buildStaticAuthorityOptions","TokenCache","ResponseMode","AuthenticationScheme","AuthorizationCodeClient","ApiId","AuthError","RefreshTokenClient","SilentFlowClient","UsernamePasswordClient","NodeAuthError","createClientAuthError","ClientAuthErrorCodes","NodeConstants","Constants","ClientAssertion","getClientAssertion","StringUtils","OIDC_DEFAULT_SCOPES","ServerTelemetryManager","Authority","AuthorityFactory"],"mappings":";;;;;;;;;;;;;;;AAAA;;;AAGG;AAuDH;;;AAGG;MACmB,iBAAiB,CAAA;AA4BnC;;AAEG;A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CAAC,IAAI,CAAC,YAAY;AAC3C,YAAA,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB;AACnD,YAAA,sBAAsB,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,sBAAsB;AAC/D,YAAA,iBAAiB,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB;YACrD,wBAAwB;AACxB,YAAA,0BAA0B,EACtB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,0BAA0B;SAClD,CAAC;QAEF,OAAOC,2BAAgB,CAAC,wBAAwB,CAC5C,YAAY,EACZ,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,EAChC,IAAI,CAAC,OAAO,EACZ,gBAAgB,EAChB,IAAI,CAAC,MAAM,EACX,oBAAoB,CACvB,CAAC;KACL;AAED;;AAEG;IACH,UAAU,GAAA;AACN,QAAA,KAAK,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;KAC7B;AACJ;;;;"}
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
/*! @azure/msal-node v2.13.1 2024-08-29 */
|
|
2
|
-
'use strict';
|
|
3
|
-
'use strict';
|
|
4
|
-
|
|
5
|
-
var jwt = require('jsonwebtoken');
|
|
6
|
-
var msalCommon = require('@azure/msal-common');
|
|
7
|
-
var EncodingUtils = require('../utils/EncodingUtils.cjs');
|
|
8
|
-
var Constants = require('../utils/Constants.cjs');
|
|
9
|
-
|
|
10
|
-
/*
|
|
11
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
12
|
-
* Licensed under the MIT License.
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* Client assertion of type jwt-bearer used in confidential client flows
|
|
16
|
-
* @public
|
|
17
|
-
*/
|
|
18
|
-
class ClientAssertion {
|
|
19
|
-
/**
|
|
20
|
-
* Initialize the ClientAssertion class from the clientAssertion passed by the user
|
|
21
|
-
* @param assertion - refer https://tools.ietf.org/html/rfc7521
|
|
22
|
-
*/
|
|
23
|
-
static fromAssertion(assertion) {
|
|
24
|
-
const clientAssertion = new ClientAssertion();
|
|
25
|
-
clientAssertion.jwt = assertion;
|
|
26
|
-
return clientAssertion;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* @deprecated Use fromCertificateWithSha256Thumbprint instead, with a SHA-256 thumprint
|
|
30
|
-
* Initialize the ClientAssertion class from the certificate passed by the user
|
|
31
|
-
* @param thumbprint - identifier of a certificate
|
|
32
|
-
* @param privateKey - secret key
|
|
33
|
-
* @param publicCertificate - electronic document provided to prove the ownership of the public key
|
|
34
|
-
*/
|
|
35
|
-
static fromCertificate(thumbprint, privateKey, publicCertificate) {
|
|
36
|
-
const clientAssertion = new ClientAssertion();
|
|
37
|
-
clientAssertion.privateKey = privateKey;
|
|
38
|
-
clientAssertion.thumbprint = thumbprint;
|
|
39
|
-
clientAssertion.useSha256 = false;
|
|
40
|
-
if (publicCertificate) {
|
|
41
|
-
clientAssertion.publicCertificate =
|
|
42
|
-
this.parseCertificate(publicCertificate);
|
|
43
|
-
}
|
|
44
|
-
return clientAssertion;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Initialize the ClientAssertion class from the certificate passed by the user
|
|
48
|
-
* @param thumbprint - identifier of a certificate
|
|
49
|
-
* @param privateKey - secret key
|
|
50
|
-
* @param publicCertificate - electronic document provided to prove the ownership of the public key
|
|
51
|
-
*/
|
|
52
|
-
static fromCertificateWithSha256Thumbprint(thumbprint, privateKey, publicCertificate) {
|
|
53
|
-
const clientAssertion = new ClientAssertion();
|
|
54
|
-
clientAssertion.privateKey = privateKey;
|
|
55
|
-
clientAssertion.thumbprint = thumbprint;
|
|
56
|
-
clientAssertion.useSha256 = true;
|
|
57
|
-
if (publicCertificate) {
|
|
58
|
-
clientAssertion.publicCertificate =
|
|
59
|
-
this.parseCertificate(publicCertificate);
|
|
60
|
-
}
|
|
61
|
-
return clientAssertion;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Update JWT for certificate based clientAssertion, if passed by the user, uses it as is
|
|
65
|
-
* @param cryptoProvider - library's crypto helper
|
|
66
|
-
* @param issuer - iss claim
|
|
67
|
-
* @param jwtAudience - aud claim
|
|
68
|
-
*/
|
|
69
|
-
getJwt(cryptoProvider, issuer, jwtAudience) {
|
|
70
|
-
// if assertion was created from certificate, check if jwt is expired and create new one.
|
|
71
|
-
if (this.privateKey && this.thumbprint) {
|
|
72
|
-
if (this.jwt &&
|
|
73
|
-
!this.isExpired() &&
|
|
74
|
-
issuer === this.issuer &&
|
|
75
|
-
jwtAudience === this.jwtAudience) {
|
|
76
|
-
return this.jwt;
|
|
77
|
-
}
|
|
78
|
-
return this.createJwt(cryptoProvider, issuer, jwtAudience);
|
|
79
|
-
}
|
|
80
|
-
/*
|
|
81
|
-
* if assertion was created by caller, then we just append it. It is up to the caller to
|
|
82
|
-
* ensure that it contains necessary claims and that it is not expired.
|
|
83
|
-
*/
|
|
84
|
-
if (this.jwt) {
|
|
85
|
-
return this.jwt;
|
|
86
|
-
}
|
|
87
|
-
throw msalCommon.createClientAuthError(msalCommon.ClientAuthErrorCodes.invalidAssertion);
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* JWT format and required claims specified: https://tools.ietf.org/html/rfc7523#section-3
|
|
91
|
-
*/
|
|
92
|
-
createJwt(cryptoProvider, issuer, jwtAudience) {
|
|
93
|
-
this.issuer = issuer;
|
|
94
|
-
this.jwtAudience = jwtAudience;
|
|
95
|
-
const issuedAt = msalCommon.TimeUtils.nowSeconds();
|
|
96
|
-
this.expirationTime = issuedAt + 600;
|
|
97
|
-
const algorithm = this.useSha256
|
|
98
|
-
? Constants.JwtConstants.PSS_256
|
|
99
|
-
: Constants.JwtConstants.RSA_256;
|
|
100
|
-
const header = {
|
|
101
|
-
alg: algorithm,
|
|
102
|
-
};
|
|
103
|
-
const thumbprintHeader = this.useSha256
|
|
104
|
-
? Constants.JwtConstants.X5T_256
|
|
105
|
-
: Constants.JwtConstants.X5T;
|
|
106
|
-
Object.assign(header, {
|
|
107
|
-
[thumbprintHeader]: EncodingUtils.EncodingUtils.base64EncodeUrl(this.thumbprint, "hex"),
|
|
108
|
-
});
|
|
109
|
-
if (this.publicCertificate) {
|
|
110
|
-
Object.assign(header, {
|
|
111
|
-
[Constants.JwtConstants.X5C]: this.publicCertificate,
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
const payload = {
|
|
115
|
-
[Constants.JwtConstants.AUDIENCE]: this.jwtAudience,
|
|
116
|
-
[Constants.JwtConstants.EXPIRATION_TIME]: this.expirationTime,
|
|
117
|
-
[Constants.JwtConstants.ISSUER]: this.issuer,
|
|
118
|
-
[Constants.JwtConstants.SUBJECT]: this.issuer,
|
|
119
|
-
[Constants.JwtConstants.NOT_BEFORE]: issuedAt,
|
|
120
|
-
[Constants.JwtConstants.JWT_ID]: cryptoProvider.createNewGuid(),
|
|
121
|
-
};
|
|
122
|
-
this.jwt = jwt.sign(payload, this.privateKey, { header });
|
|
123
|
-
return this.jwt;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Utility API to check expiration
|
|
127
|
-
*/
|
|
128
|
-
isExpired() {
|
|
129
|
-
return this.expirationTime < msalCommon.TimeUtils.nowSeconds();
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Extracts the raw certs from a given certificate string and returns them in an array.
|
|
133
|
-
* @param publicCertificate - electronic document provided to prove the ownership of the public key
|
|
134
|
-
*/
|
|
135
|
-
static parseCertificate(publicCertificate) {
|
|
136
|
-
/**
|
|
137
|
-
* This is regex to identify the certs in a given certificate string.
|
|
138
|
-
* We want to look for the contents between the BEGIN and END certificate strings, without the associated newlines.
|
|
139
|
-
* The information in parens "(.+?)" is the capture group to represent the cert we want isolated.
|
|
140
|
-
* "." means any string character, "+" means match 1 or more times, and "?" means the shortest match.
|
|
141
|
-
* The "g" at the end of the regex means search the string globally, and the "s" enables the "." to match newlines.
|
|
142
|
-
*/
|
|
143
|
-
const regexToFindCerts = /-----BEGIN CERTIFICATE-----\r*\n(.+?)\r*\n-----END CERTIFICATE-----/gs;
|
|
144
|
-
const certs = [];
|
|
145
|
-
let matches;
|
|
146
|
-
while ((matches = regexToFindCerts.exec(publicCertificate)) !== null) {
|
|
147
|
-
// matches[1] represents the first parens capture group in the regex.
|
|
148
|
-
certs.push(matches[1].replace(/\r*\n/g, msalCommon.Constants.EMPTY_STRING));
|
|
149
|
-
}
|
|
150
|
-
return certs;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
exports.ClientAssertion = ClientAssertion;
|
|
155
|
-
//# sourceMappingURL=ClientAssertion.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ClientAssertion.cjs","sources":["../../src/client/ClientAssertion.ts"],"sourcesContent":[null],"names":["createClientAuthError","ClientAuthErrorCodes","TimeUtils","JwtConstants","EncodingUtils","Constants"],"mappings":";;;;;;;;;AAAA;;;AAGG;AAaH;;;AAGG;MACU,eAAe,CAAA;AAUxB;;;AAGG;IACI,OAAO,aAAa,CAAC,SAAiB,EAAA;AACzC,QAAA,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;AAC9C,QAAA,eAAe,CAAC,GAAG,GAAG,SAAS,CAAC;AAChC,QAAA,OAAO,eAAe,CAAC;KAC1B;AAED;;;;;;AAMG;AACI,IAAA,OAAO,eAAe,CACzB,UAAkB,EAClB,UAAkB,EAClB,iBAA0B,EAAA;AAE1B,QAAA,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;AAC9C,QAAA,eAAe,CAAC,UAAU,GAAG,UAAU,CAAC;AACxC,QAAA,eAAe,CAAC,UAAU,GAAG,UAAU,CAAC;AACxC,QAAA,eAAe,CAAC,SAAS,GAAG,KAAK,CAAC;AAClC,QAAA,IAAI,iBAAiB,EAAE;AACnB,YAAA,eAAe,CAAC,iBAAiB;AAC7B,gBAAA,IAAI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