@azure/identity 4.10.3-alpha.20250714.3 → 4.11.0-alpha.20250718.3
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/README.md +19 -1
- package/dist/browser/client/identityClient.js +30 -18
- package/dist/browser/client/identityClient.js.map +1 -1
- package/dist/browser/constants.d.ts +1 -1
- package/dist/browser/constants.d.ts.map +1 -1
- package/dist/browser/constants.js +1 -1
- package/dist/browser/constants.js.map +1 -1
- package/dist/browser/credentials/brokerCredential.d.ts +35 -0
- package/dist/browser/credentials/brokerCredential.d.ts.map +1 -0
- package/dist/browser/credentials/brokerCredential.js +69 -0
- package/dist/browser/credentials/brokerCredential.js.map +1 -0
- package/dist/browser/credentials/chainedTokenCredential.js +1 -1
- package/dist/browser/credentials/chainedTokenCredential.js.map +1 -1
- package/dist/browser/credentials/clientSecretCredential-browser.mjs.map +1 -1
- package/dist/browser/credentials/clientSecretCredential.js +7 -2
- package/dist/browser/credentials/defaultAzureCredentialFunctions.d.ts +62 -0
- package/dist/browser/credentials/defaultAzureCredentialFunctions.d.ts.map +1 -0
- package/dist/browser/credentials/defaultAzureCredentialFunctions.js +143 -0
- package/dist/browser/credentials/defaultAzureCredentialFunctions.js.map +1 -0
- package/dist/browser/credentials/interactiveBrowserCredential-browser.mjs.map +1 -1
- package/dist/browser/credentials/interactiveBrowserCredential.js +19 -6
- package/dist/browser/credentials/managedIdentityCredential/imdsMsi.js +4 -6
- package/dist/browser/credentials/managedIdentityCredential/imdsMsi.js.map +1 -1
- package/dist/browser/credentials/managedIdentityCredential/imdsRetryPolicy.js +2 -2
- package/dist/browser/credentials/managedIdentityCredential/imdsRetryPolicy.js.map +1 -1
- package/dist/browser/credentials/managedIdentityCredential/tokenExchangeMsi.js +7 -1
- package/dist/browser/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +1 -1
- package/dist/browser/credentials/usernamePasswordCredential-browser.mjs.map +1 -1
- package/dist/browser/credentials/usernamePasswordCredential.js +7 -1
- package/dist/browser/credentials/visualStudioCodeCredentialOptions.d.ts +0 -4
- package/dist/browser/credentials/visualStudioCodeCredentialOptions.d.ts.map +1 -1
- package/dist/browser/credentials/visualStudioCodeCredentialOptions.js.map +1 -1
- package/dist/browser/credentials/visualStudioCodeCredentialPlugin.d.ts +0 -4
- package/dist/browser/credentials/visualStudioCodeCredentialPlugin.d.ts.map +1 -1
- package/dist/browser/credentials/visualStudioCodeCredentialPlugin.js.map +1 -1
- package/dist/browser/errors.js +21 -0
- package/dist/browser/errors.js.map +1 -1
- package/dist/browser/msal/browserFlows/msalBrowserCommon.js +15 -15
- package/dist/browser/msal/browserFlows/msalBrowserCommon.js.map +1 -1
- package/dist/browser/msal/nodeFlows/msalClient.d.ts +13 -0
- package/dist/browser/msal/nodeFlows/msalClient.d.ts.map +1 -1
- package/dist/browser/msal/nodeFlows/msalClient.js +127 -94
- package/dist/browser/msal/nodeFlows/msalClient.js.map +1 -1
- package/dist/browser/msal/nodeFlows/msalPlugins.d.ts +19 -1
- package/dist/browser/msal/nodeFlows/msalPlugins.d.ts.map +1 -1
- package/dist/browser/msal/nodeFlows/msalPlugins.js +61 -16
- package/dist/browser/msal/nodeFlows/msalPlugins.js.map +1 -1
- package/dist/browser/msal/utils.js +3 -4
- package/dist/browser/msal/utils.js.map +1 -1
- package/dist/browser/plugins/provider.d.ts +2 -2
- package/dist/browser/plugins/provider.d.ts.map +1 -1
- package/dist/browser/plugins/provider.js.map +1 -1
- package/dist/browser/regionalAuthority.js +1 -2
- package/dist/browser/regionalAuthority.js.map +1 -1
- package/dist/browser/tokenProvider.js +1 -2
- package/dist/browser/tokenProvider.js.map +1 -1
- package/dist/browser/util/logging.js +6 -2
- package/dist/browser/util/logging.js.map +1 -1
- package/dist/browser/util/processMultiTenantRequest-browser.mjs.map +1 -1
- package/dist/browser/util/processMultiTenantRequest.js +1 -2
- package/dist/browser/util/processUtils.d.ts +1 -1
- package/dist/browser/util/processUtils.d.ts.map +1 -1
- package/dist/browser/util/processUtils.js +1 -1
- package/dist/browser/util/processUtils.js.map +1 -1
- package/dist/commonjs/client/identityClient.js +30 -18
- package/dist/commonjs/client/identityClient.js.map +1 -1
- package/dist/commonjs/constants.d.ts +1 -1
- package/dist/commonjs/constants.d.ts.map +1 -1
- package/dist/commonjs/constants.js +1 -1
- package/dist/commonjs/constants.js.map +1 -1
- package/dist/commonjs/credentials/authorizationCodeCredential.js +17 -3
- package/dist/commonjs/credentials/authorizationCodeCredential.js.map +1 -1
- package/dist/commonjs/credentials/azureCliCredential.js +15 -12
- package/dist/commonjs/credentials/azureCliCredential.js.map +1 -1
- package/dist/commonjs/credentials/azureDeveloperCliCredential.js +12 -10
- package/dist/commonjs/credentials/azureDeveloperCliCredential.js.map +1 -1
- package/dist/commonjs/credentials/azurePipelinesCredential.js +9 -5
- package/dist/commonjs/credentials/azurePipelinesCredential.js.map +1 -1
- package/dist/commonjs/credentials/azurePowerShellCredential.js +10 -7
- package/dist/commonjs/credentials/azurePowerShellCredential.js.map +1 -1
- package/dist/commonjs/credentials/brokerCredential.d.ts +35 -0
- package/dist/commonjs/credentials/brokerCredential.d.ts.map +1 -0
- package/dist/commonjs/credentials/brokerCredential.js +73 -0
- package/dist/commonjs/credentials/brokerCredential.js.map +1 -0
- package/dist/commonjs/credentials/chainedTokenCredential.js +1 -1
- package/dist/commonjs/credentials/chainedTokenCredential.js.map +1 -1
- package/dist/commonjs/credentials/clientAssertionCredential.js +11 -2
- package/dist/commonjs/credentials/clientAssertionCredential.js.map +1 -1
- package/dist/commonjs/credentials/clientCertificateCredential.js +19 -9
- package/dist/commonjs/credentials/clientCertificateCredential.js.map +1 -1
- package/dist/commonjs/credentials/clientSecretCredential.js +10 -2
- package/dist/commonjs/credentials/clientSecretCredential.js.map +1 -1
- package/dist/commonjs/credentials/defaultAzureCredential.d.ts +12 -14
- package/dist/commonjs/credentials/defaultAzureCredential.d.ts.map +1 -1
- package/dist/commonjs/credentials/defaultAzureCredential.js +48 -113
- package/dist/commonjs/credentials/defaultAzureCredential.js.map +1 -1
- package/dist/commonjs/credentials/defaultAzureCredentialFunctions.d.ts +62 -0
- package/dist/commonjs/credentials/defaultAzureCredentialFunctions.d.ts.map +1 -0
- package/dist/commonjs/credentials/defaultAzureCredentialFunctions.js +153 -0
- package/dist/commonjs/credentials/defaultAzureCredentialFunctions.js.map +1 -0
- package/dist/commonjs/credentials/deviceCodeCredential.js +24 -10
- package/dist/commonjs/credentials/deviceCodeCredential.js.map +1 -1
- package/dist/commonjs/credentials/environmentCredential.js +4 -6
- package/dist/commonjs/credentials/environmentCredential.js.map +1 -1
- package/dist/commonjs/credentials/interactiveBrowserCredential.js +30 -11
- package/dist/commonjs/credentials/interactiveBrowserCredential.js.map +1 -1
- package/dist/commonjs/credentials/managedIdentityCredential/imdsMsi.js +4 -6
- package/dist/commonjs/credentials/managedIdentityCredential/imdsMsi.js.map +1 -1
- package/dist/commonjs/credentials/managedIdentityCredential/imdsRetryPolicy.js +2 -2
- package/dist/commonjs/credentials/managedIdentityCredential/imdsRetryPolicy.js.map +1 -1
- package/dist/commonjs/credentials/managedIdentityCredential/index.js +28 -18
- package/dist/commonjs/credentials/managedIdentityCredential/index.js.map +1 -1
- package/dist/commonjs/credentials/managedIdentityCredential/tokenExchangeMsi.js +7 -1
- package/dist/commonjs/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +1 -1
- package/dist/commonjs/credentials/onBehalfOfCredential.js +13 -1
- package/dist/commonjs/credentials/onBehalfOfCredential.js.map +1 -1
- package/dist/commonjs/credentials/usernamePasswordCredential.js +10 -2
- package/dist/commonjs/credentials/usernamePasswordCredential.js.map +1 -1
- package/dist/commonjs/credentials/visualStudioCodeCredential.d.ts +15 -26
- package/dist/commonjs/credentials/visualStudioCodeCredential.d.ts.map +1 -1
- package/dist/commonjs/credentials/visualStudioCodeCredential.js +69 -130
- package/dist/commonjs/credentials/visualStudioCodeCredential.js.map +1 -1
- package/dist/commonjs/credentials/visualStudioCodeCredentialOptions.d.ts +0 -4
- package/dist/commonjs/credentials/visualStudioCodeCredentialOptions.d.ts.map +1 -1
- package/dist/commonjs/credentials/visualStudioCodeCredentialOptions.js.map +1 -1
- package/dist/commonjs/credentials/visualStudioCodeCredentialPlugin.d.ts +0 -4
- package/dist/commonjs/credentials/visualStudioCodeCredentialPlugin.d.ts.map +1 -1
- package/dist/commonjs/credentials/visualStudioCodeCredentialPlugin.js.map +1 -1
- package/dist/commonjs/credentials/workloadIdentityCredential.js +5 -3
- package/dist/commonjs/credentials/workloadIdentityCredential.js.map +1 -1
- package/dist/commonjs/errors.js +21 -0
- package/dist/commonjs/errors.js.map +1 -1
- package/dist/commonjs/msal/browserFlows/msalBrowserCommon.js +15 -15
- package/dist/commonjs/msal/browserFlows/msalBrowserCommon.js.map +1 -1
- package/dist/commonjs/msal/nodeFlows/msalClient.d.ts +13 -0
- package/dist/commonjs/msal/nodeFlows/msalClient.d.ts.map +1 -1
- package/dist/commonjs/msal/nodeFlows/msalClient.js +127 -94
- package/dist/commonjs/msal/nodeFlows/msalClient.js.map +1 -1
- package/dist/commonjs/msal/nodeFlows/msalPlugins.d.ts +19 -1
- package/dist/commonjs/msal/nodeFlows/msalPlugins.d.ts.map +1 -1
- package/dist/commonjs/msal/nodeFlows/msalPlugins.js +63 -17
- package/dist/commonjs/msal/nodeFlows/msalPlugins.js.map +1 -1
- package/dist/commonjs/msal/utils.js +3 -4
- package/dist/commonjs/msal/utils.js.map +1 -1
- package/dist/commonjs/plugins/consumer.d.ts.map +1 -1
- package/dist/commonjs/plugins/consumer.js +1 -2
- package/dist/commonjs/plugins/consumer.js.map +1 -1
- package/dist/commonjs/plugins/provider.d.ts +2 -2
- package/dist/commonjs/plugins/provider.d.ts.map +1 -1
- package/dist/commonjs/plugins/provider.js.map +1 -1
- package/dist/commonjs/regionalAuthority.js +1 -2
- package/dist/commonjs/regionalAuthority.js.map +1 -1
- package/dist/commonjs/tokenProvider.js +1 -2
- package/dist/commonjs/tokenProvider.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/commonjs/util/logging.js +6 -2
- package/dist/commonjs/util/logging.js.map +1 -1
- package/dist/commonjs/util/processMultiTenantRequest.js +2 -3
- package/dist/commonjs/util/processMultiTenantRequest.js.map +1 -1
- package/dist/commonjs/util/processUtils.d.ts +1 -1
- package/dist/commonjs/util/processUtils.d.ts.map +1 -1
- package/dist/commonjs/util/processUtils.js +2 -2
- package/dist/commonjs/util/processUtils.js.map +1 -1
- package/dist/esm/client/identityClient.js +30 -18
- package/dist/esm/client/identityClient.js.map +1 -1
- package/dist/esm/constants.d.ts +1 -1
- package/dist/esm/constants.d.ts.map +1 -1
- package/dist/esm/constants.js +1 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/credentials/authorizationCodeCredential.js +17 -3
- package/dist/esm/credentials/authorizationCodeCredential.js.map +1 -1
- package/dist/esm/credentials/azureCliCredential.js +15 -12
- package/dist/esm/credentials/azureCliCredential.js.map +1 -1
- package/dist/esm/credentials/azureDeveloperCliCredential.js +12 -10
- package/dist/esm/credentials/azureDeveloperCliCredential.js.map +1 -1
- package/dist/esm/credentials/azurePipelinesCredential.js +9 -5
- package/dist/esm/credentials/azurePipelinesCredential.js.map +1 -1
- package/dist/esm/credentials/azurePowerShellCredential.js +10 -7
- package/dist/esm/credentials/azurePowerShellCredential.js.map +1 -1
- package/dist/esm/credentials/brokerCredential.d.ts +35 -0
- package/dist/esm/credentials/brokerCredential.d.ts.map +1 -0
- package/dist/esm/credentials/brokerCredential.js +69 -0
- package/dist/esm/credentials/brokerCredential.js.map +1 -0
- package/dist/esm/credentials/chainedTokenCredential.js +1 -1
- package/dist/esm/credentials/chainedTokenCredential.js.map +1 -1
- package/dist/esm/credentials/clientAssertionCredential.js +11 -2
- package/dist/esm/credentials/clientAssertionCredential.js.map +1 -1
- package/dist/esm/credentials/clientCertificateCredential.js +19 -9
- package/dist/esm/credentials/clientCertificateCredential.js.map +1 -1
- package/dist/esm/credentials/clientSecretCredential.js +10 -2
- package/dist/esm/credentials/clientSecretCredential.js.map +1 -1
- package/dist/esm/credentials/defaultAzureCredential.d.ts +12 -14
- package/dist/esm/credentials/defaultAzureCredential.d.ts.map +1 -1
- package/dist/esm/credentials/defaultAzureCredential.js +43 -106
- package/dist/esm/credentials/defaultAzureCredential.js.map +1 -1
- package/dist/esm/credentials/defaultAzureCredentialFunctions.d.ts +62 -0
- package/dist/esm/credentials/defaultAzureCredentialFunctions.d.ts.map +1 -0
- package/dist/esm/credentials/defaultAzureCredentialFunctions.js +143 -0
- package/dist/esm/credentials/defaultAzureCredentialFunctions.js.map +1 -0
- package/dist/esm/credentials/deviceCodeCredential.js +24 -10
- package/dist/esm/credentials/deviceCodeCredential.js.map +1 -1
- package/dist/esm/credentials/environmentCredential.js +4 -6
- package/dist/esm/credentials/environmentCredential.js.map +1 -1
- package/dist/esm/credentials/interactiveBrowserCredential.js +30 -11
- package/dist/esm/credentials/interactiveBrowserCredential.js.map +1 -1
- package/dist/esm/credentials/managedIdentityCredential/imdsMsi.js +4 -6
- package/dist/esm/credentials/managedIdentityCredential/imdsMsi.js.map +1 -1
- package/dist/esm/credentials/managedIdentityCredential/imdsRetryPolicy.js +2 -2
- package/dist/esm/credentials/managedIdentityCredential/imdsRetryPolicy.js.map +1 -1
- package/dist/esm/credentials/managedIdentityCredential/index.js +28 -18
- package/dist/esm/credentials/managedIdentityCredential/index.js.map +1 -1
- package/dist/esm/credentials/managedIdentityCredential/tokenExchangeMsi.js +7 -1
- package/dist/esm/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +1 -1
- package/dist/esm/credentials/onBehalfOfCredential.js +13 -1
- package/dist/esm/credentials/onBehalfOfCredential.js.map +1 -1
- package/dist/esm/credentials/usernamePasswordCredential.js +10 -2
- package/dist/esm/credentials/usernamePasswordCredential.js.map +1 -1
- package/dist/esm/credentials/visualStudioCodeCredential.d.ts +15 -26
- package/dist/esm/credentials/visualStudioCodeCredential.d.ts.map +1 -1
- package/dist/esm/credentials/visualStudioCodeCredential.js +69 -128
- package/dist/esm/credentials/visualStudioCodeCredential.js.map +1 -1
- package/dist/esm/credentials/visualStudioCodeCredentialOptions.d.ts +0 -4
- package/dist/esm/credentials/visualStudioCodeCredentialOptions.d.ts.map +1 -1
- package/dist/esm/credentials/visualStudioCodeCredentialOptions.js.map +1 -1
- package/dist/esm/credentials/visualStudioCodeCredentialPlugin.d.ts +0 -4
- package/dist/esm/credentials/visualStudioCodeCredentialPlugin.d.ts.map +1 -1
- package/dist/esm/credentials/visualStudioCodeCredentialPlugin.js.map +1 -1
- package/dist/esm/credentials/workloadIdentityCredential.js +5 -3
- package/dist/esm/credentials/workloadIdentityCredential.js.map +1 -1
- package/dist/esm/errors.js +21 -0
- package/dist/esm/errors.js.map +1 -1
- package/dist/esm/msal/browserFlows/msalBrowserCommon.js +15 -15
- package/dist/esm/msal/browserFlows/msalBrowserCommon.js.map +1 -1
- package/dist/esm/msal/nodeFlows/msalClient.d.ts +13 -0
- package/dist/esm/msal/nodeFlows/msalClient.d.ts.map +1 -1
- package/dist/esm/msal/nodeFlows/msalClient.js +127 -94
- package/dist/esm/msal/nodeFlows/msalClient.js.map +1 -1
- package/dist/esm/msal/nodeFlows/msalPlugins.d.ts +19 -1
- package/dist/esm/msal/nodeFlows/msalPlugins.d.ts.map +1 -1
- package/dist/esm/msal/nodeFlows/msalPlugins.js +61 -16
- package/dist/esm/msal/nodeFlows/msalPlugins.js.map +1 -1
- package/dist/esm/msal/utils.js +3 -4
- package/dist/esm/msal/utils.js.map +1 -1
- package/dist/esm/plugins/consumer.d.ts.map +1 -1
- package/dist/esm/plugins/consumer.js +2 -3
- package/dist/esm/plugins/consumer.js.map +1 -1
- package/dist/esm/plugins/provider.d.ts +2 -2
- package/dist/esm/plugins/provider.d.ts.map +1 -1
- package/dist/esm/plugins/provider.js.map +1 -1
- package/dist/esm/regionalAuthority.js +1 -2
- package/dist/esm/regionalAuthority.js.map +1 -1
- package/dist/esm/tokenProvider.js +1 -2
- package/dist/esm/tokenProvider.js.map +1 -1
- package/dist/esm/util/logging.js +6 -2
- package/dist/esm/util/logging.js.map +1 -1
- package/dist/esm/util/processMultiTenantRequest.js +2 -3
- package/dist/esm/util/processMultiTenantRequest.js.map +1 -1
- package/dist/esm/util/processUtils.d.ts +1 -1
- package/dist/esm/util/processUtils.d.ts.map +1 -1
- package/dist/esm/util/processUtils.js +1 -1
- package/dist/esm/util/processUtils.js.map +1 -1
- package/dist/workerd/client/identityClient.js +30 -18
- package/dist/workerd/client/identityClient.js.map +1 -1
- package/dist/workerd/constants.d.ts +1 -1
- package/dist/workerd/constants.d.ts.map +1 -1
- package/dist/workerd/constants.js +1 -1
- package/dist/workerd/constants.js.map +1 -1
- package/dist/workerd/credentials/authorizationCodeCredential.js +17 -3
- package/dist/workerd/credentials/authorizationCodeCredential.js.map +1 -1
- package/dist/workerd/credentials/azureCliCredential.js +15 -12
- package/dist/workerd/credentials/azureCliCredential.js.map +1 -1
- package/dist/workerd/credentials/azureDeveloperCliCredential.js +12 -10
- package/dist/workerd/credentials/azureDeveloperCliCredential.js.map +1 -1
- package/dist/workerd/credentials/azurePipelinesCredential.js +9 -5
- package/dist/workerd/credentials/azurePipelinesCredential.js.map +1 -1
- package/dist/workerd/credentials/azurePowerShellCredential.js +10 -7
- package/dist/workerd/credentials/azurePowerShellCredential.js.map +1 -1
- package/dist/workerd/credentials/brokerCredential.d.ts +35 -0
- package/dist/workerd/credentials/brokerCredential.d.ts.map +1 -0
- package/dist/workerd/credentials/brokerCredential.js +69 -0
- package/dist/workerd/credentials/brokerCredential.js.map +1 -0
- package/dist/workerd/credentials/chainedTokenCredential.js +1 -1
- package/dist/workerd/credentials/chainedTokenCredential.js.map +1 -1
- package/dist/workerd/credentials/clientAssertionCredential.js +11 -2
- package/dist/workerd/credentials/clientAssertionCredential.js.map +1 -1
- package/dist/workerd/credentials/clientCertificateCredential.js +19 -9
- package/dist/workerd/credentials/clientCertificateCredential.js.map +1 -1
- package/dist/workerd/credentials/clientSecretCredential.js +10 -2
- package/dist/workerd/credentials/clientSecretCredential.js.map +1 -1
- package/dist/workerd/credentials/defaultAzureCredential.d.ts +12 -14
- package/dist/workerd/credentials/defaultAzureCredential.d.ts.map +1 -1
- package/dist/workerd/credentials/defaultAzureCredential.js +43 -106
- package/dist/workerd/credentials/defaultAzureCredential.js.map +1 -1
- package/dist/workerd/credentials/defaultAzureCredentialFunctions.d.ts +62 -0
- package/dist/workerd/credentials/defaultAzureCredentialFunctions.d.ts.map +1 -0
- package/dist/workerd/credentials/defaultAzureCredentialFunctions.js +143 -0
- package/dist/workerd/credentials/defaultAzureCredentialFunctions.js.map +1 -0
- package/dist/workerd/credentials/deviceCodeCredential.js +24 -10
- package/dist/workerd/credentials/deviceCodeCredential.js.map +1 -1
- package/dist/workerd/credentials/environmentCredential.js +4 -6
- package/dist/workerd/credentials/environmentCredential.js.map +1 -1
- package/dist/workerd/credentials/interactiveBrowserCredential.js +30 -11
- package/dist/workerd/credentials/interactiveBrowserCredential.js.map +1 -1
- package/dist/workerd/credentials/managedIdentityCredential/imdsMsi.js +4 -6
- package/dist/workerd/credentials/managedIdentityCredential/imdsMsi.js.map +1 -1
- package/dist/workerd/credentials/managedIdentityCredential/imdsRetryPolicy.js +2 -2
- package/dist/workerd/credentials/managedIdentityCredential/imdsRetryPolicy.js.map +1 -1
- package/dist/workerd/credentials/managedIdentityCredential/index.js +28 -18
- package/dist/workerd/credentials/managedIdentityCredential/index.js.map +1 -1
- package/dist/workerd/credentials/managedIdentityCredential/tokenExchangeMsi.js +7 -1
- package/dist/workerd/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +1 -1
- package/dist/workerd/credentials/onBehalfOfCredential.js +13 -1
- package/dist/workerd/credentials/onBehalfOfCredential.js.map +1 -1
- package/dist/workerd/credentials/usernamePasswordCredential.js +10 -2
- package/dist/workerd/credentials/usernamePasswordCredential.js.map +1 -1
- package/dist/workerd/credentials/visualStudioCodeCredential.d.ts +15 -26
- package/dist/workerd/credentials/visualStudioCodeCredential.d.ts.map +1 -1
- package/dist/workerd/credentials/visualStudioCodeCredential.js +69 -128
- package/dist/workerd/credentials/visualStudioCodeCredential.js.map +1 -1
- package/dist/workerd/credentials/visualStudioCodeCredentialOptions.d.ts +0 -4
- package/dist/workerd/credentials/visualStudioCodeCredentialOptions.d.ts.map +1 -1
- package/dist/workerd/credentials/visualStudioCodeCredentialOptions.js.map +1 -1
- package/dist/workerd/credentials/visualStudioCodeCredentialPlugin.d.ts +0 -4
- package/dist/workerd/credentials/visualStudioCodeCredentialPlugin.d.ts.map +1 -1
- package/dist/workerd/credentials/visualStudioCodeCredentialPlugin.js.map +1 -1
- package/dist/workerd/credentials/workloadIdentityCredential.js +5 -3
- package/dist/workerd/credentials/workloadIdentityCredential.js.map +1 -1
- package/dist/workerd/errors.js +21 -0
- package/dist/workerd/errors.js.map +1 -1
- package/dist/workerd/msal/browserFlows/msalBrowserCommon.js +15 -15
- package/dist/workerd/msal/browserFlows/msalBrowserCommon.js.map +1 -1
- package/dist/workerd/msal/nodeFlows/msalClient.d.ts +13 -0
- package/dist/workerd/msal/nodeFlows/msalClient.d.ts.map +1 -1
- package/dist/workerd/msal/nodeFlows/msalClient.js +127 -94
- package/dist/workerd/msal/nodeFlows/msalClient.js.map +1 -1
- package/dist/workerd/msal/nodeFlows/msalPlugins.d.ts +19 -1
- package/dist/workerd/msal/nodeFlows/msalPlugins.d.ts.map +1 -1
- package/dist/workerd/msal/nodeFlows/msalPlugins.js +61 -16
- package/dist/workerd/msal/nodeFlows/msalPlugins.js.map +1 -1
- package/dist/workerd/msal/utils.js +3 -4
- package/dist/workerd/msal/utils.js.map +1 -1
- package/dist/workerd/plugins/consumer.d.ts.map +1 -1
- package/dist/workerd/plugins/consumer.js +2 -3
- package/dist/workerd/plugins/consumer.js.map +1 -1
- package/dist/workerd/plugins/provider.d.ts +2 -2
- package/dist/workerd/plugins/provider.d.ts.map +1 -1
- package/dist/workerd/plugins/provider.js.map +1 -1
- package/dist/workerd/regionalAuthority.js +1 -2
- package/dist/workerd/regionalAuthority.js.map +1 -1
- package/dist/workerd/tokenProvider.js +1 -2
- package/dist/workerd/tokenProvider.js.map +1 -1
- package/dist/workerd/util/logging.js +6 -2
- package/dist/workerd/util/logging.js.map +1 -1
- package/dist/workerd/util/processMultiTenantRequest.js +2 -3
- package/dist/workerd/util/processMultiTenantRequest.js.map +1 -1
- package/dist/workerd/util/processUtils.d.ts +1 -1
- package/dist/workerd/util/processUtils.d.ts.map +1 -1
- package/dist/workerd/util/processUtils.js +1 -1
- package/dist/workerd/util/processUtils.js.map +1 -1
- package/package.json +2 -2
@@ -22,11 +22,14 @@ const msalLogger = credentialLogger("MsalClient");
|
|
22
22
|
* @returns The MSAL configuration object.
|
23
23
|
*/
|
24
24
|
export function generateMsalConfiguration(clientId, tenantId, msalClientOptions = {}) {
|
25
|
-
|
26
|
-
const resolvedTenant = resolveTenantId((_a = msalClientOptions.logger) !== null && _a !== void 0 ? _a : msalLogger, tenantId, clientId);
|
25
|
+
const resolvedTenant = resolveTenantId(msalClientOptions.logger ?? msalLogger, tenantId, clientId);
|
27
26
|
// TODO: move and reuse getIdentityClientAuthorityHost
|
28
27
|
const authority = getAuthority(resolvedTenant, getAuthorityHost(msalClientOptions));
|
29
|
-
const httpClient = new IdentityClient(
|
28
|
+
const httpClient = new IdentityClient({
|
29
|
+
...msalClientOptions.tokenCredentialOptions,
|
30
|
+
authorityHost: authority,
|
31
|
+
loggingOptions: msalClientOptions.loggingOptions,
|
32
|
+
});
|
30
33
|
const msalConfig = {
|
31
34
|
auth: {
|
32
35
|
clientId,
|
@@ -36,9 +39,9 @@ export function generateMsalConfiguration(clientId, tenantId, msalClientOptions
|
|
36
39
|
system: {
|
37
40
|
networkClient: httpClient,
|
38
41
|
loggerOptions: {
|
39
|
-
loggerCallback: defaultLoggerCallback(
|
42
|
+
loggerCallback: defaultLoggerCallback(msalClientOptions.logger ?? msalLogger),
|
40
43
|
logLevel: getMSALLogLevel(getLogLevel()),
|
41
|
-
piiLoggingEnabled:
|
44
|
+
piiLoggingEnabled: msalClientOptions.loggingOptions?.enableUnsafeSupportLogging,
|
42
45
|
},
|
43
46
|
},
|
44
47
|
};
|
@@ -55,14 +58,13 @@ export function generateMsalConfiguration(clientId, tenantId, msalClientOptions
|
|
55
58
|
* @public
|
56
59
|
*/
|
57
60
|
export function createMsalClient(clientId, tenantId, createMsalClientOptions = {}) {
|
58
|
-
var _a;
|
59
61
|
const state = {
|
60
62
|
msalConfig: generateMsalConfiguration(clientId, tenantId, createMsalClientOptions),
|
61
63
|
cachedAccount: createMsalClientOptions.authenticationRecord
|
62
64
|
? publicToMsal(createMsalClientOptions.authenticationRecord)
|
63
65
|
: null,
|
64
66
|
pluginConfiguration: msalPlugins.generatePluginConfiguration(createMsalClientOptions),
|
65
|
-
logger:
|
67
|
+
logger: createMsalClientOptions.logger ?? msalLogger,
|
66
68
|
};
|
67
69
|
const publicApps = new Map();
|
68
70
|
async function getPublicApp(options = {}) {
|
@@ -78,7 +80,11 @@ export function createMsalClient(clientId, tenantId, createMsalClientOptions = {
|
|
78
80
|
? state.pluginConfiguration.cache.cachePluginCae
|
79
81
|
: state.pluginConfiguration.cache.cachePlugin;
|
80
82
|
state.msalConfig.auth.clientCapabilities = options.enableCae ? ["cp1"] : undefined;
|
81
|
-
publicClientApp = new msal.PublicClientApplication(
|
83
|
+
publicClientApp = new msal.PublicClientApplication({
|
84
|
+
...state.msalConfig,
|
85
|
+
broker: { nativeBrokerPlugin: state.pluginConfiguration.broker.nativeBrokerPlugin },
|
86
|
+
cache: { cachePlugin: await cachePlugin },
|
87
|
+
});
|
82
88
|
publicApps.set(appKey, publicClientApp);
|
83
89
|
return publicClientApp;
|
84
90
|
}
|
@@ -96,7 +102,11 @@ export function createMsalClient(clientId, tenantId, createMsalClientOptions = {
|
|
96
102
|
? state.pluginConfiguration.cache.cachePluginCae
|
97
103
|
: state.pluginConfiguration.cache.cachePlugin;
|
98
104
|
state.msalConfig.auth.clientCapabilities = options.enableCae ? ["cp1"] : undefined;
|
99
|
-
confidentialClientApp = new msal.ConfidentialClientApplication(
|
105
|
+
confidentialClientApp = new msal.ConfidentialClientApplication({
|
106
|
+
...state.msalConfig,
|
107
|
+
broker: { nativeBrokerPlugin: state.pluginConfiguration.broker.nativeBrokerPlugin },
|
108
|
+
cache: { cachePlugin: await cachePlugin },
|
109
|
+
});
|
100
110
|
confidentialApps.set(appKey, confidentialClientApp);
|
101
111
|
return confidentialClientApp;
|
102
112
|
}
|
@@ -115,7 +125,7 @@ export function createMsalClient(clientId, tenantId, createMsalClientOptions = {
|
|
115
125
|
claims: state.cachedClaims,
|
116
126
|
};
|
117
127
|
if (state.pluginConfiguration.broker.isEnabled) {
|
118
|
-
silentRequest.tokenQueryParameters
|
128
|
+
silentRequest.tokenQueryParameters ||= {};
|
119
129
|
if (state.pluginConfiguration.broker.enableMsaPassthrough) {
|
120
130
|
silentRequest.tokenQueryParameters["msal_request_type"] = "consumer_passthrough";
|
121
131
|
}
|
@@ -139,7 +149,7 @@ export function createMsalClient(clientId, tenantId, createMsalClientOptions = {
|
|
139
149
|
* if the user is creating cross-tenant requests
|
140
150
|
*/
|
141
151
|
function calculateRequestAuthority(options) {
|
142
|
-
if (options
|
152
|
+
if (options?.tenantId) {
|
143
153
|
return getAuthority(options.tenantId, getAuthorityHost(createMsalClientOptions));
|
144
154
|
}
|
145
155
|
return state.msalConfig.auth.authority;
|
@@ -155,7 +165,6 @@ export function createMsalClient(clientId, tenantId, createMsalClientOptions = {
|
|
155
165
|
* @returns A promise that resolves to an AccessToken object containing the access token and its expiration timestamp.
|
156
166
|
*/
|
157
167
|
async function withSilentAuthentication(msalApp, scopes, options, onAuthenticationRequired) {
|
158
|
-
var _a, _b;
|
159
168
|
let response = null;
|
160
169
|
try {
|
161
170
|
response = await getTokenSilent(msalApp, scopes, options);
|
@@ -183,17 +192,16 @@ export function createMsalClient(clientId, tenantId, createMsalClientOptions = {
|
|
183
192
|
}
|
184
193
|
// At this point we should have a token, process it
|
185
194
|
ensureValidMsalToken(scopes, response, options);
|
186
|
-
state.cachedAccount =
|
195
|
+
state.cachedAccount = response?.account ?? null;
|
187
196
|
state.logger.getToken.info(formatSuccess(scopes));
|
188
197
|
return {
|
189
198
|
token: response.accessToken,
|
190
199
|
expiresOnTimestamp: response.expiresOn.getTime(),
|
191
|
-
refreshAfterTimestamp:
|
200
|
+
refreshAfterTimestamp: response.refreshOn?.getTime(),
|
192
201
|
tokenType: response.tokenType,
|
193
202
|
};
|
194
203
|
}
|
195
204
|
async function getTokenByClientSecret(scopes, clientSecret, options = {}) {
|
196
|
-
var _a;
|
197
205
|
state.logger.getToken.info(`Attempting to acquire token using client secret`);
|
198
206
|
state.msalConfig.auth.clientSecret = clientSecret;
|
199
207
|
const msalApp = await getConfidentialApp(options);
|
@@ -202,14 +210,14 @@ export function createMsalClient(clientId, tenantId, createMsalClientOptions = {
|
|
202
210
|
scopes,
|
203
211
|
authority: calculateRequestAuthority(options),
|
204
212
|
azureRegion: calculateRegionalAuthority(),
|
205
|
-
claims: options
|
213
|
+
claims: options?.claims,
|
206
214
|
});
|
207
215
|
ensureValidMsalToken(scopes, response, options);
|
208
216
|
state.logger.getToken.info(formatSuccess(scopes));
|
209
217
|
return {
|
210
218
|
token: response.accessToken,
|
211
219
|
expiresOnTimestamp: response.expiresOn.getTime(),
|
212
|
-
refreshAfterTimestamp:
|
220
|
+
refreshAfterTimestamp: response.refreshOn?.getTime(),
|
213
221
|
tokenType: response.tokenType,
|
214
222
|
};
|
215
223
|
}
|
@@ -218,7 +226,6 @@ export function createMsalClient(clientId, tenantId, createMsalClientOptions = {
|
|
218
226
|
}
|
219
227
|
}
|
220
228
|
async function getTokenByClientAssertion(scopes, clientAssertion, options = {}) {
|
221
|
-
var _a;
|
222
229
|
state.logger.getToken.info(`Attempting to acquire token using client assertion`);
|
223
230
|
state.msalConfig.auth.clientAssertion = clientAssertion;
|
224
231
|
const msalApp = await getConfidentialApp(options);
|
@@ -227,7 +234,7 @@ export function createMsalClient(clientId, tenantId, createMsalClientOptions = {
|
|
227
234
|
scopes,
|
228
235
|
authority: calculateRequestAuthority(options),
|
229
236
|
azureRegion: calculateRegionalAuthority(),
|
230
|
-
claims: options
|
237
|
+
claims: options?.claims,
|
231
238
|
clientAssertion,
|
232
239
|
});
|
233
240
|
ensureValidMsalToken(scopes, response, options);
|
@@ -235,7 +242,7 @@ export function createMsalClient(clientId, tenantId, createMsalClientOptions = {
|
|
235
242
|
return {
|
236
243
|
token: response.accessToken,
|
237
244
|
expiresOnTimestamp: response.expiresOn.getTime(),
|
238
|
-
refreshAfterTimestamp:
|
245
|
+
refreshAfterTimestamp: response.refreshOn?.getTime(),
|
239
246
|
tokenType: response.tokenType,
|
240
247
|
};
|
241
248
|
}
|
@@ -244,7 +251,6 @@ export function createMsalClient(clientId, tenantId, createMsalClientOptions = {
|
|
244
251
|
}
|
245
252
|
}
|
246
253
|
async function getTokenByClientCertificate(scopes, certificate, options = {}) {
|
247
|
-
var _a;
|
248
254
|
state.logger.getToken.info(`Attempting to acquire token using client certificate`);
|
249
255
|
state.msalConfig.auth.clientCertificate = certificate;
|
250
256
|
const msalApp = await getConfidentialApp(options);
|
@@ -253,14 +259,14 @@ export function createMsalClient(clientId, tenantId, createMsalClientOptions = {
|
|
253
259
|
scopes,
|
254
260
|
authority: calculateRequestAuthority(options),
|
255
261
|
azureRegion: calculateRegionalAuthority(),
|
256
|
-
claims: options
|
262
|
+
claims: options?.claims,
|
257
263
|
});
|
258
264
|
ensureValidMsalToken(scopes, response, options);
|
259
265
|
state.logger.getToken.info(formatSuccess(scopes));
|
260
266
|
return {
|
261
267
|
token: response.accessToken,
|
262
268
|
expiresOnTimestamp: response.expiresOn.getTime(),
|
263
|
-
refreshAfterTimestamp:
|
269
|
+
refreshAfterTimestamp: response.refreshOn?.getTime(),
|
264
270
|
tokenType: response.tokenType,
|
265
271
|
};
|
266
272
|
}
|
@@ -272,13 +278,12 @@ export function createMsalClient(clientId, tenantId, createMsalClientOptions = {
|
|
272
278
|
state.logger.getToken.info(`Attempting to acquire token using device code`);
|
273
279
|
const msalApp = await getPublicApp(options);
|
274
280
|
return withSilentAuthentication(msalApp, scopes, options, () => {
|
275
|
-
var _a, _b;
|
276
281
|
const requestOptions = {
|
277
282
|
scopes,
|
278
|
-
cancel:
|
283
|
+
cancel: options?.abortSignal?.aborted ?? false,
|
279
284
|
deviceCodeCallback,
|
280
285
|
authority: calculateRequestAuthority(options),
|
281
|
-
claims: options
|
286
|
+
claims: options?.claims,
|
282
287
|
};
|
283
288
|
const deviceCodeRequest = msalApp.acquireTokenByDeviceCode(requestOptions);
|
284
289
|
if (options.abortSignal) {
|
@@ -298,7 +303,7 @@ export function createMsalClient(clientId, tenantId, createMsalClientOptions = {
|
|
298
303
|
username,
|
299
304
|
password,
|
300
305
|
authority: calculateRequestAuthority(options),
|
301
|
-
claims: options
|
306
|
+
claims: options?.claims,
|
302
307
|
};
|
303
308
|
return msalApp.acquireTokenByUsernamePassword(requestOptions);
|
304
309
|
});
|
@@ -327,12 +332,11 @@ export function createMsalClient(clientId, tenantId, createMsalClientOptions = {
|
|
327
332
|
redirectUri,
|
328
333
|
code: authorizationCode,
|
329
334
|
authority: calculateRequestAuthority(options),
|
330
|
-
claims: options
|
335
|
+
claims: options?.claims,
|
331
336
|
});
|
332
337
|
});
|
333
338
|
}
|
334
339
|
async function getTokenOnBehalfOf(scopes, userAssertionToken, clientCredentials, options = {}) {
|
335
|
-
var _a;
|
336
340
|
msalLogger.getToken.info(`Attempting to acquire token on behalf of another user`);
|
337
341
|
if (typeof clientCredentials === "string") {
|
338
342
|
// Client secret
|
@@ -362,7 +366,7 @@ export function createMsalClient(clientId, tenantId, createMsalClientOptions = {
|
|
362
366
|
return {
|
363
367
|
token: response.accessToken,
|
364
368
|
expiresOnTimestamp: response.expiresOn.getTime(),
|
365
|
-
refreshAfterTimestamp:
|
369
|
+
refreshAfterTimestamp: response.refreshOn?.getTime(),
|
366
370
|
tokenType: response.tokenType,
|
367
371
|
};
|
368
372
|
}
|
@@ -370,79 +374,107 @@ export function createMsalClient(clientId, tenantId, createMsalClientOptions = {
|
|
370
374
|
throw handleMsalError(scopes, err, options);
|
371
375
|
}
|
372
376
|
}
|
373
|
-
|
374
|
-
|
377
|
+
/**
|
378
|
+
* Creates a base interactive request configuration for MSAL interactive authentication.
|
379
|
+
* This is shared between interactive and brokered authentication flows.
|
380
|
+
*
|
381
|
+
* @internal
|
382
|
+
*/
|
383
|
+
function createBaseInteractiveRequest(scopes, options) {
|
384
|
+
return {
|
385
|
+
openBrowser: async (url) => {
|
386
|
+
const open = await import("open");
|
387
|
+
await open.default(url, { wait: true, newInstance: true });
|
388
|
+
},
|
389
|
+
scopes,
|
390
|
+
authority: calculateRequestAuthority(options),
|
391
|
+
claims: options?.claims,
|
392
|
+
loginHint: options?.loginHint,
|
393
|
+
errorTemplate: options?.browserCustomizationOptions?.errorMessage,
|
394
|
+
successTemplate: options?.browserCustomizationOptions?.successMessage,
|
395
|
+
prompt: options?.loginHint ? "login" : "select_account",
|
396
|
+
};
|
397
|
+
}
|
398
|
+
/**
|
399
|
+
* @internal
|
400
|
+
*/
|
401
|
+
async function getBrokeredTokenInternal(scopes, useDefaultBrokerAccount, options = {}) {
|
402
|
+
msalLogger.verbose("Authentication will resume through the broker");
|
375
403
|
const app = await getPublicApp(options);
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
404
|
+
const interactiveRequest = createBaseInteractiveRequest(scopes, options);
|
405
|
+
if (state.pluginConfiguration.broker.parentWindowHandle) {
|
406
|
+
interactiveRequest.windowHandle = Buffer.from(state.pluginConfiguration.broker.parentWindowHandle);
|
407
|
+
}
|
408
|
+
else {
|
409
|
+
// this is a bug, as the pluginConfiguration handler should validate this case.
|
410
|
+
msalLogger.warning("Parent window handle is not specified for the broker. This may cause unexpected behavior. Please provide the parentWindowHandle.");
|
411
|
+
}
|
412
|
+
if (state.pluginConfiguration.broker.enableMsaPassthrough) {
|
413
|
+
(interactiveRequest.tokenQueryParameters ??= {})["msal_request_type"] =
|
414
|
+
"consumer_passthrough";
|
415
|
+
}
|
416
|
+
if (useDefaultBrokerAccount) {
|
417
|
+
interactiveRequest.prompt = "none";
|
418
|
+
msalLogger.verbose("Attempting broker authentication using the default broker account");
|
419
|
+
}
|
420
|
+
else {
|
421
|
+
msalLogger.verbose("Attempting broker authentication without the default broker account");
|
422
|
+
}
|
423
|
+
if (options.proofOfPossessionOptions) {
|
424
|
+
interactiveRequest.shrNonce = options.proofOfPossessionOptions.nonce;
|
425
|
+
interactiveRequest.authenticationScheme = "pop";
|
426
|
+
interactiveRequest.resourceRequestMethod =
|
427
|
+
options.proofOfPossessionOptions.resourceRequestMethod;
|
428
|
+
interactiveRequest.resourceRequestUri = options.proofOfPossessionOptions.resourceRequestUrl;
|
429
|
+
}
|
430
|
+
try {
|
431
|
+
return await app.acquireTokenInteractive(interactiveRequest);
|
432
|
+
}
|
433
|
+
catch (e) {
|
434
|
+
msalLogger.verbose(`Failed to authenticate through the broker: ${e.message}`);
|
435
|
+
if (options.disableAutomaticAuthentication) {
|
436
|
+
throw new AuthenticationRequiredError({
|
437
|
+
scopes,
|
438
|
+
getTokenOptions: options,
|
439
|
+
message: "Cannot silently authenticate with default broker account.",
|
440
|
+
});
|
396
441
|
}
|
442
|
+
// If we tried to use the default broker account and failed, fall back to interactive authentication
|
397
443
|
if (useDefaultBrokerAccount) {
|
398
|
-
|
399
|
-
msalLogger.verbose("Attempting broker authentication using the default broker account");
|
444
|
+
return getBrokeredTokenInternal(scopes, false, options);
|
400
445
|
}
|
401
446
|
else {
|
402
|
-
|
403
|
-
}
|
404
|
-
if (options.proofOfPossessionOptions) {
|
405
|
-
interactiveRequest.shrNonce = options.proofOfPossessionOptions.nonce;
|
406
|
-
interactiveRequest.authenticationScheme = "pop";
|
407
|
-
interactiveRequest.resourceRequestMethod =
|
408
|
-
options.proofOfPossessionOptions.resourceRequestMethod;
|
409
|
-
interactiveRequest.resourceRequestUri = options.proofOfPossessionOptions.resourceRequestUrl;
|
410
|
-
}
|
411
|
-
try {
|
412
|
-
return await app.acquireTokenInteractive(interactiveRequest);
|
413
|
-
}
|
414
|
-
catch (e) {
|
415
|
-
msalLogger.verbose(`Failed to authenticate through the broker: ${e.message}`);
|
416
|
-
// If we tried to use the default broker account and failed, fall back to interactive authentication
|
417
|
-
if (useDefaultBrokerAccount) {
|
418
|
-
return getBrokeredToken(/* useDefaultBrokerAccount: */ false);
|
419
|
-
}
|
420
|
-
else {
|
421
|
-
throw e;
|
422
|
-
}
|
447
|
+
throw e;
|
423
448
|
}
|
424
449
|
}
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
450
|
+
}
|
451
|
+
/**
|
452
|
+
* A helper function that supports brokered authentication through the MSAL's public application.
|
453
|
+
*
|
454
|
+
* When useDefaultBrokerAccount is true, the method will attempt to authenticate using the default broker account.
|
455
|
+
* If the default broker account is not available, the method will fall back to interactive authentication.
|
456
|
+
*/
|
457
|
+
async function getBrokeredToken(scopes, useDefaultBrokerAccount, options = {}) {
|
458
|
+
msalLogger.getToken.info(`Attempting to acquire token using brokered authentication with useDefaultBrokerAccount: ${useDefaultBrokerAccount}`);
|
459
|
+
const response = await getBrokeredTokenInternal(scopes, useDefaultBrokerAccount, options);
|
460
|
+
ensureValidMsalToken(scopes, response, options);
|
461
|
+
ensureValidMsalToken(scopes, response, options);
|
462
|
+
state.cachedAccount = response?.account ?? null;
|
463
|
+
state.logger.getToken.info(formatSuccess(scopes));
|
464
|
+
return {
|
465
|
+
token: response.accessToken,
|
466
|
+
expiresOnTimestamp: response.expiresOn.getTime(),
|
467
|
+
refreshAfterTimestamp: response.refreshOn?.getTime(),
|
468
|
+
tokenType: response.tokenType,
|
469
|
+
};
|
470
|
+
}
|
471
|
+
async function getTokenByInteractiveRequest(scopes, options = {}) {
|
472
|
+
msalLogger.getToken.info(`Attempting to acquire token interactively`);
|
473
|
+
const app = await getPublicApp(options);
|
441
474
|
return withSilentAuthentication(app, scopes, options, async () => {
|
442
|
-
|
443
|
-
const interactiveRequest = createBaseInteractiveRequest();
|
475
|
+
const interactiveRequest = createBaseInteractiveRequest(scopes, options);
|
444
476
|
if (state.pluginConfiguration.broker.isEnabled) {
|
445
|
-
return
|
477
|
+
return getBrokeredTokenInternal(scopes, state.pluginConfiguration.broker.useDefaultBrokerAccount ?? false, options);
|
446
478
|
}
|
447
479
|
if (options.proofOfPossessionOptions) {
|
448
480
|
interactiveRequest.shrNonce = options.proofOfPossessionOptions.nonce;
|
@@ -456,6 +488,7 @@ export function createMsalClient(clientId, tenantId, createMsalClientOptions = {
|
|
456
488
|
}
|
457
489
|
return {
|
458
490
|
getActiveAccount,
|
491
|
+
getBrokeredToken,
|
459
492
|
getTokenByClientSecret,
|
460
493
|
getTokenByClientAssertion,
|
461
494
|
getTokenByClientCertificate,
|