@azure/identity 4.5.0-beta.2 → 4.5.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +65 -74
- package/dist/index.js +190 -81
- package/dist/index.js.map +1 -1
- package/dist-esm/src/client/identityClient.js +4 -2
- package/dist-esm/src/client/identityClient.js.map +1 -1
- package/dist-esm/src/constants.js +2 -2
- package/dist-esm/src/constants.js.map +1 -1
- package/dist-esm/src/credentials/authorityValidationOptions.js +1 -1
- package/dist-esm/src/credentials/authorityValidationOptions.js.map +1 -1
- package/dist-esm/src/credentials/authorizationCodeCredential.browser.js +1 -1
- package/dist-esm/src/credentials/authorizationCodeCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/authorizationCodeCredential.js +1 -1
- package/dist-esm/src/credentials/authorizationCodeCredential.js.map +1 -1
- package/dist-esm/src/credentials/authorizationCodeCredentialOptions.js +1 -1
- package/dist-esm/src/credentials/authorizationCodeCredentialOptions.js.map +1 -1
- package/dist-esm/src/credentials/azureApplicationCredential.browser.js +1 -1
- package/dist-esm/src/credentials/azureApplicationCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/azureApplicationCredential.js +1 -1
- package/dist-esm/src/credentials/azureApplicationCredential.js.map +1 -1
- package/dist-esm/src/credentials/azureApplicationCredentialOptions.js +1 -1
- package/dist-esm/src/credentials/azureApplicationCredentialOptions.js.map +1 -1
- package/dist-esm/src/credentials/azureCliCredential.browser.js +1 -1
- package/dist-esm/src/credentials/azureCliCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/azureCliCredential.js +3 -1
- package/dist-esm/src/credentials/azureCliCredential.js.map +1 -1
- package/dist-esm/src/credentials/azureCliCredentialOptions.js +1 -1
- package/dist-esm/src/credentials/azureCliCredentialOptions.js.map +1 -1
- package/dist-esm/src/credentials/azureDeveloperCliCredential.browser.js +1 -1
- package/dist-esm/src/credentials/azureDeveloperCliCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/azureDeveloperCliCredential.js +2 -1
- package/dist-esm/src/credentials/azureDeveloperCliCredential.js.map +1 -1
- package/dist-esm/src/credentials/azureDeveloperCliCredentialOptions.js +1 -1
- package/dist-esm/src/credentials/azureDeveloperCliCredentialOptions.js.map +1 -1
- package/dist-esm/src/credentials/azurePipelinesCredential.browser.js +1 -1
- package/dist-esm/src/credentials/azurePipelinesCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/azurePipelinesCredential.js +16 -5
- package/dist-esm/src/credentials/azurePipelinesCredential.js.map +1 -1
- package/dist-esm/src/credentials/azurePipelinesCredentialOptions.js +1 -1
- package/dist-esm/src/credentials/azurePipelinesCredentialOptions.js.map +1 -1
- package/dist-esm/src/credentials/azurePowerShellCredential.browser.js +1 -1
- package/dist-esm/src/credentials/azurePowerShellCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/azurePowerShellCredential.js +2 -1
- package/dist-esm/src/credentials/azurePowerShellCredential.js.map +1 -1
- package/dist-esm/src/credentials/azurePowerShellCredentialOptions.js +1 -1
- package/dist-esm/src/credentials/azurePowerShellCredentialOptions.js.map +1 -1
- package/dist-esm/src/credentials/brokerAuthOptions.js.map +1 -1
- package/dist-esm/src/credentials/browserCustomizationOptions.js +1 -1
- package/dist-esm/src/credentials/browserCustomizationOptions.js.map +1 -1
- package/dist-esm/src/credentials/chainedTokenCredential.js +9 -2
- package/dist-esm/src/credentials/chainedTokenCredential.js.map +1 -1
- package/dist-esm/src/credentials/clientAssertionCredential.browser.js +1 -1
- package/dist-esm/src/credentials/clientAssertionCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/clientAssertionCredential.js +1 -1
- package/dist-esm/src/credentials/clientAssertionCredential.js.map +1 -1
- package/dist-esm/src/credentials/clientAssertionCredentialOptions.js +1 -1
- package/dist-esm/src/credentials/clientAssertionCredentialOptions.js.map +1 -1
- package/dist-esm/src/credentials/clientCertificateCredential.browser.js +1 -1
- package/dist-esm/src/credentials/clientCertificateCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/clientCertificateCredential.js +1 -1
- package/dist-esm/src/credentials/clientCertificateCredential.js.map +1 -1
- package/dist-esm/src/credentials/clientCertificateCredentialOptions.js +1 -1
- package/dist-esm/src/credentials/clientCertificateCredentialOptions.js.map +1 -1
- package/dist-esm/src/credentials/clientSecretCredential.browser.js +1 -1
- package/dist-esm/src/credentials/clientSecretCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/clientSecretCredential.js +1 -1
- package/dist-esm/src/credentials/clientSecretCredential.js.map +1 -1
- package/dist-esm/src/credentials/clientSecretCredentialOptions.js +1 -1
- package/dist-esm/src/credentials/clientSecretCredentialOptions.js.map +1 -1
- package/dist-esm/src/credentials/credentialPersistenceOptions.js +1 -1
- package/dist-esm/src/credentials/credentialPersistenceOptions.js.map +1 -1
- package/dist-esm/src/credentials/defaultAzureCredential.browser.js +1 -1
- package/dist-esm/src/credentials/defaultAzureCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/defaultAzureCredential.js +1 -1
- package/dist-esm/src/credentials/defaultAzureCredential.js.map +1 -1
- package/dist-esm/src/credentials/defaultAzureCredentialOptions.js +1 -1
- package/dist-esm/src/credentials/defaultAzureCredentialOptions.js.map +1 -1
- package/dist-esm/src/credentials/deviceCodeCredential.browser.js +1 -1
- package/dist-esm/src/credentials/deviceCodeCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/deviceCodeCredential.js +7 -5
- package/dist-esm/src/credentials/deviceCodeCredential.js.map +1 -1
- package/dist-esm/src/credentials/deviceCodeCredentialOptions.js +1 -1
- package/dist-esm/src/credentials/deviceCodeCredentialOptions.js.map +1 -1
- package/dist-esm/src/credentials/environmentCredential.browser.js +1 -1
- package/dist-esm/src/credentials/environmentCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/environmentCredential.js +1 -1
- package/dist-esm/src/credentials/environmentCredential.js.map +1 -1
- package/dist-esm/src/credentials/environmentCredentialOptions.js +1 -1
- package/dist-esm/src/credentials/environmentCredentialOptions.js.map +1 -1
- package/dist-esm/src/credentials/interactiveBrowserCredential.browser.js +1 -1
- package/dist-esm/src/credentials/interactiveBrowserCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/interactiveBrowserCredential.js +1 -1
- package/dist-esm/src/credentials/interactiveBrowserCredential.js.map +1 -1
- package/dist-esm/src/credentials/interactiveBrowserCredentialOptions.js +1 -1
- package/dist-esm/src/credentials/interactiveBrowserCredentialOptions.js.map +1 -1
- package/dist-esm/src/credentials/interactiveCredentialOptions.js +1 -1
- package/dist-esm/src/credentials/interactiveCredentialOptions.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/appServiceMsi2017.js +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/appServiceMsi2017.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/appServiceMsi2019.js +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/appServiceMsi2019.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/arcMsi.js +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/arcMsi.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/cloudShellMsi.js +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/cloudShellMsi.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/constants.js +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/constants.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/fabricMsi.js +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/fabricMsi.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/imdsMsi.js +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/imdsMsi.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/imdsRetryPolicy.js +6 -10
- package/dist-esm/src/credentials/managedIdentityCredential/imdsRetryPolicy.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/index.browser.js +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/index.browser.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/index.js +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/index.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/legacyMsiProvider.js +8 -1
- package/dist-esm/src/credentials/managedIdentityCredential/legacyMsiProvider.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/models.js +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/models.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/msalMsiProvider.js +21 -4
- package/dist-esm/src/credentials/managedIdentityCredential/msalMsiProvider.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/tokenExchangeMsi.js +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/utils.js +26 -1
- package/dist-esm/src/credentials/managedIdentityCredential/utils.js.map +1 -1
- package/dist-esm/src/credentials/multiTenantTokenCredentialOptions.js +1 -1
- package/dist-esm/src/credentials/multiTenantTokenCredentialOptions.js.map +1 -1
- package/dist-esm/src/credentials/onBehalfOfCredential.browser.js +1 -1
- package/dist-esm/src/credentials/onBehalfOfCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/onBehalfOfCredential.js +1 -1
- package/dist-esm/src/credentials/onBehalfOfCredential.js.map +1 -1
- package/dist-esm/src/credentials/onBehalfOfCredentialOptions.js +1 -1
- package/dist-esm/src/credentials/onBehalfOfCredentialOptions.js.map +1 -1
- package/dist-esm/src/credentials/usernamePasswordCredential.browser.js +1 -1
- package/dist-esm/src/credentials/usernamePasswordCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/usernamePasswordCredential.js +1 -1
- package/dist-esm/src/credentials/usernamePasswordCredential.js.map +1 -1
- package/dist-esm/src/credentials/usernamePasswordCredentialOptions.js +1 -1
- package/dist-esm/src/credentials/usernamePasswordCredentialOptions.js.map +1 -1
- package/dist-esm/src/credentials/visualStudioCodeCredential.browser.js +1 -1
- package/dist-esm/src/credentials/visualStudioCodeCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/visualStudioCodeCredential.js +1 -1
- package/dist-esm/src/credentials/visualStudioCodeCredential.js.map +1 -1
- package/dist-esm/src/credentials/visualStudioCodeCredentialOptions.js +1 -1
- package/dist-esm/src/credentials/visualStudioCodeCredentialOptions.js.map +1 -1
- package/dist-esm/src/credentials/visualStudioCodeCredentialPlugin.js +1 -1
- package/dist-esm/src/credentials/visualStudioCodeCredentialPlugin.js.map +1 -1
- package/dist-esm/src/credentials/workloadIdentityCredential.browser.js +1 -1
- package/dist-esm/src/credentials/workloadIdentityCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/workloadIdentityCredential.js +1 -1
- package/dist-esm/src/credentials/workloadIdentityCredential.js.map +1 -1
- package/dist-esm/src/credentials/workloadIdentityCredentialOptions.js +1 -1
- package/dist-esm/src/credentials/workloadIdentityCredentialOptions.js.map +1 -1
- package/dist-esm/src/errors.js +1 -2
- package/dist-esm/src/errors.js.map +1 -1
- package/dist-esm/src/index.js +1 -1
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/msal/browserFlows/flows.js +1 -1
- package/dist-esm/src/msal/browserFlows/flows.js.map +1 -1
- package/dist-esm/src/msal/browserFlows/msalAuthCode.js +2 -2
- package/dist-esm/src/msal/browserFlows/msalAuthCode.js.map +1 -1
- package/dist-esm/src/msal/browserFlows/msalBrowserCommon.js +4 -1
- package/dist-esm/src/msal/browserFlows/msalBrowserCommon.js.map +1 -1
- package/dist-esm/src/msal/credentials.js +1 -1
- package/dist-esm/src/msal/credentials.js.map +1 -1
- package/dist-esm/src/msal/msal.browser.js +1 -1
- package/dist-esm/src/msal/msal.browser.js.map +1 -1
- package/dist-esm/src/msal/msal.js +1 -1
- package/dist-esm/src/msal/msal.js.map +1 -1
- package/dist-esm/src/msal/nodeFlows/brokerOptions.js.map +1 -1
- package/dist-esm/src/msal/nodeFlows/msalClient.js +42 -8
- package/dist-esm/src/msal/nodeFlows/msalClient.js.map +1 -1
- package/dist-esm/src/msal/nodeFlows/msalPlugins.js +1 -1
- package/dist-esm/src/msal/nodeFlows/msalPlugins.js.map +1 -1
- package/dist-esm/src/msal/nodeFlows/tokenCachePersistenceOptions.js +1 -1
- package/dist-esm/src/msal/nodeFlows/tokenCachePersistenceOptions.js.map +1 -1
- package/dist-esm/src/msal/types.js +1 -1
- package/dist-esm/src/msal/types.js.map +1 -1
- package/dist-esm/src/msal/utils.js +17 -3
- package/dist-esm/src/msal/utils.js.map +1 -1
- package/dist-esm/src/plugins/consumer.browser.js +1 -1
- package/dist-esm/src/plugins/consumer.browser.js.map +1 -1
- package/dist-esm/src/plugins/consumer.js +7 -9
- package/dist-esm/src/plugins/consumer.js.map +1 -1
- package/dist-esm/src/plugins/provider.js +1 -1
- package/dist-esm/src/plugins/provider.js.map +1 -1
- package/dist-esm/src/regionalAuthority.js +1 -1
- package/dist-esm/src/regionalAuthority.js.map +1 -1
- package/dist-esm/src/tokenCredentialOptions.js +1 -1
- package/dist-esm/src/tokenCredentialOptions.js.map +1 -1
- package/dist-esm/src/tokenProvider.js +4 -4
- package/dist-esm/src/tokenProvider.js.map +1 -1
- package/dist-esm/src/util/authHostEnv.browser.js +1 -1
- package/dist-esm/src/util/authHostEnv.browser.js.map +1 -1
- package/dist-esm/src/util/identityTokenEndpoint.js +1 -1
- package/dist-esm/src/util/identityTokenEndpoint.js.map +1 -1
- package/dist-esm/src/util/logging.js +1 -1
- package/dist-esm/src/util/logging.js.map +1 -1
- package/dist-esm/src/util/processMultiTenantRequest.browser.js +1 -1
- package/dist-esm/src/util/processMultiTenantRequest.browser.js.map +1 -1
- package/dist-esm/src/util/processMultiTenantRequest.js +1 -1
- package/dist-esm/src/util/processMultiTenantRequest.js.map +1 -1
- package/dist-esm/src/util/processUtils.js +1 -1
- package/dist-esm/src/util/processUtils.js.map +1 -1
- package/dist-esm/src/util/scopeUtils.js +1 -1
- package/dist-esm/src/util/scopeUtils.js.map +1 -1
- package/dist-esm/src/util/tenantIdUtils.js +1 -1
- package/dist-esm/src/util/tenantIdUtils.js.map +1 -1
- package/dist-esm/src/util/tracing.js +1 -1
- package/dist-esm/src/util/tracing.js.map +1 -1
- package/package.json +20 -19
- package/types/identity.d.ts +74 -50
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@azure/identity",
|
3
3
|
"sdk-type": "client",
|
4
|
-
"version": "4.5.0
|
4
|
+
"version": "4.5.0",
|
5
5
|
"description": "Provides credential implementations for Azure SDK libraries that can authenticate with Microsoft Entra ID",
|
6
6
|
"main": "dist/index.js",
|
7
7
|
"module": "dist-esm/src/index.js",
|
@@ -47,28 +47,29 @@
|
|
47
47
|
},
|
48
48
|
"scripts": {
|
49
49
|
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
|
50
|
+
"build": "npm run clean && npm run extract-api && tsc -p . && dev-tool run bundle",
|
50
51
|
"build:samples": "echo Obsolete.",
|
51
52
|
"build:test": "echo skipped. actual commands inlined in browser test scripts",
|
52
|
-
"
|
53
|
+
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
|
53
54
|
"clean": "rimraf --glob dist dist-* types *.tgz *.log",
|
54
55
|
"execute:samples": "dev-tool samples run samples-dev",
|
55
56
|
"extract-api": "tsc -p . && dev-tool run extract-api",
|
56
57
|
"format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
|
57
|
-
"
|
58
|
+
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
|
58
59
|
"integration-test:browser": "echo skipped",
|
59
|
-
"integration-test:node": "dev-tool run test:node-ts-input -- --timeout 180000 'test/public/node/*.spec.ts' 'test/internal/node/*.spec.ts'",
|
60
60
|
"integration-test:managed-identity": "dev-tool run test:node-ts-input -- --timeout 180000 'test/integration/**/*.spec.ts'",
|
61
|
-
"integration-test": "
|
62
|
-
"lint
|
63
|
-
"lint": "eslint package.json api-extractor.json src test --
|
61
|
+
"integration-test:node": "dev-tool run test:node-ts-input -- --timeout 180000 'test/public/node/*.spec.ts' 'test/internal/node/*.spec.ts'",
|
62
|
+
"lint": "eslint package.json api-extractor.json src test",
|
63
|
+
"lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]",
|
64
64
|
"pack": "npm pack 2>&1",
|
65
|
+
"test": "npm run clean && npm run build:test && npm run unit-test && npm run integration-test",
|
65
66
|
"test:browser": "npm run clean && tsc -p . && dev-tool run bundle && npm run unit-test:browser && npm run integration-test:browser",
|
66
67
|
"test:node": "npm run clean && npm run unit-test:node && npm run integration-test:node",
|
67
|
-
"test": "npm run
|
68
|
+
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
|
68
69
|
"unit-test:browser": "dev-tool run test:browser",
|
69
|
-
"unit-test:node": "dev-tool run test:node-ts-input -- --timeout 300000 --exclude 'test/**/browser/**/*.spec.ts' --exclude 'test/integration/**/*.spec.ts' 'test/**/**/*.spec.ts'",
|
70
|
-
"unit-test:node:no-timeouts": "dev-tool run test:node-ts-input -- --timeout Infinite --exclude 'test/**/browser/**/*.spec.ts' 'test/**/**/*.spec.ts'",
|
71
|
-
"
|
70
|
+
"unit-test:node": "dev-tool run test:node-ts-input -- --timeout 300000 --exclude 'test/**/browser/**/*.spec.ts' --exclude 'test/snippets.spec.ts' --exclude 'test/integration/**/*.spec.ts' 'test/**/**/*.spec.ts'",
|
71
|
+
"unit-test:node:no-timeouts": "dev-tool run test:node-ts-input -- --timeout Infinite --exclude 'test/snippets.spec.ts' --exclude 'test/**/browser/**/*.spec.ts' 'test/**/**/*.spec.ts'",
|
72
|
+
"update-snippets": "dev-tool run update-snippets"
|
72
73
|
},
|
73
74
|
"files": [
|
74
75
|
"dist/",
|
@@ -109,14 +110,14 @@
|
|
109
110
|
"sideEffects": false,
|
110
111
|
"dependencies": {
|
111
112
|
"@azure/abort-controller": "^2.0.0",
|
112
|
-
"@azure/core-auth": "^1.
|
113
|
+
"@azure/core-auth": "^1.9.0",
|
113
114
|
"@azure/core-client": "^1.9.2",
|
114
|
-
"@azure/core-rest-pipeline": "^1.
|
115
|
+
"@azure/core-rest-pipeline": "^1.17.0",
|
115
116
|
"@azure/core-tracing": "^1.0.0",
|
116
|
-
"@azure/core-util": "^1.
|
117
|
+
"@azure/core-util": "^1.11.0",
|
117
118
|
"@azure/logger": "^1.0.0",
|
118
|
-
"@azure/msal-node": "^2.
|
119
|
-
"@azure/msal-browser": "^3.
|
119
|
+
"@azure/msal-node": "^2.15.0",
|
120
|
+
"@azure/msal-browser": "^3.26.1",
|
120
121
|
"events": "^3.0.0",
|
121
122
|
"jws": "^4.0.0",
|
122
123
|
"open": "^8.0.0",
|
@@ -125,10 +126,10 @@
|
|
125
126
|
},
|
126
127
|
"devDependencies": {
|
127
128
|
"@azure-tools/test-recorder": "^3.0.0",
|
129
|
+
"@azure-tools/test-utils": "^1.0.1",
|
128
130
|
"@azure/dev-tool": "^1.0.0",
|
129
131
|
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
|
130
132
|
"@azure/keyvault-keys": "^4.2.0",
|
131
|
-
"@azure-tools/test-utils": "^1.0.1",
|
132
133
|
"@microsoft/api-extractor": "^7.31.1",
|
133
134
|
"@types/chai": "^4.1.6",
|
134
135
|
"@types/jsonwebtoken": "^9.0.0",
|
@@ -142,7 +143,7 @@
|
|
142
143
|
"chai": "^4.2.0",
|
143
144
|
"cross-env": "^7.0.3",
|
144
145
|
"dotenv": "^16.0.0",
|
145
|
-
"eslint": "^
|
146
|
+
"eslint": "^9.9.0",
|
146
147
|
"inherits": "^2.0.3",
|
147
148
|
"jsonwebtoken": "^9.0.0",
|
148
149
|
"karma": "^6.2.0",
|
@@ -160,7 +161,7 @@
|
|
160
161
|
"rimraf": "^5.0.5",
|
161
162
|
"sinon": "^17.0.0",
|
162
163
|
"ts-node": "^10.0.0",
|
163
|
-
"typescript": "~5.
|
164
|
+
"typescript": "~5.6.2",
|
164
165
|
"util": "^0.12.1"
|
165
166
|
}
|
166
167
|
}
|
package/types/identity.d.ts
CHANGED
@@ -540,7 +540,14 @@ export declare class ChainedTokenCredential implements TokenCredential {
|
|
540
540
|
* @param sources - `TokenCredential` implementations to be tried in order.
|
541
541
|
*
|
542
542
|
* Example usage:
|
543
|
-
* ```
|
543
|
+
* ```ts snippet:chained_token_credential_example
|
544
|
+
* import { ClientSecretCredential, ChainedTokenCredential } from "@azure/identity";
|
545
|
+
*
|
546
|
+
* const tenantId = "<tenant-id>";
|
547
|
+
* const clientId = "<client-id>";
|
548
|
+
* const clientSecret = "<client-secret>";
|
549
|
+
* const anotherClientId = "<another-client-id>";
|
550
|
+
* const anotherSecret = "<another-client-secret>";
|
544
551
|
* const firstCredential = new ClientSecretCredential(tenantId, clientId, clientSecret);
|
545
552
|
* const secondCredential = new ClientSecretCredential(tenantId, anotherClientId, anotherSecret);
|
546
553
|
* const credentialChain = new ChainedTokenCredential(firstCredential, secondCredential);
|
@@ -598,7 +605,7 @@ export declare class ClientAssertionCredential implements TokenCredential {
|
|
598
605
|
/**
|
599
606
|
* Options for the {@link ClientAssertionCredential}
|
600
607
|
*/
|
601
|
-
export declare interface ClientAssertionCredentialOptions extends MultiTenantTokenCredentialOptions, AuthorityValidationOptions {
|
608
|
+
export declare interface ClientAssertionCredentialOptions extends MultiTenantTokenCredentialOptions, CredentialPersistenceOptions, AuthorityValidationOptions {
|
602
609
|
}
|
603
610
|
|
604
611
|
/**
|
@@ -758,23 +765,14 @@ export declare interface CredentialPersistenceOptions {
|
|
758
765
|
*
|
759
766
|
* Example:
|
760
767
|
*
|
761
|
-
* ```
|
762
|
-
* import { cachePersistencePlugin } from "@azure/identity-cache-persistence";
|
768
|
+
* ```ts snippet:credential_persistence_options_example
|
763
769
|
* import { useIdentityPlugin, DeviceCodeCredential } from "@azure/identity";
|
764
770
|
*
|
765
771
|
* useIdentityPlugin(cachePersistencePlugin);
|
766
|
-
*
|
767
|
-
*
|
768
|
-
*
|
769
|
-
*
|
770
|
-
* enabled: true
|
771
|
-
* }
|
772
|
-
* });
|
773
|
-
* }
|
774
|
-
*
|
775
|
-
* main().catch((error) => {
|
776
|
-
* console.error("An error occurred:", error);
|
777
|
-
* process.exit(1);
|
772
|
+
* const credential = new DeviceCodeCredential({
|
773
|
+
* tokenCachePersistenceOptions: {
|
774
|
+
* enabled: true,
|
775
|
+
* },
|
778
776
|
* });
|
779
777
|
* ```
|
780
778
|
*/
|
@@ -955,13 +953,15 @@ export declare class DeviceCodeCredential implements TokenCredential {
|
|
955
953
|
*
|
956
954
|
* Developers can configure how this message is shown by passing a custom `userPromptCallback`:
|
957
955
|
*
|
958
|
-
* ```
|
956
|
+
* ```ts snippet:device_code_credential_example
|
957
|
+
* import { DeviceCodeCredential } from "@azure/identity";
|
958
|
+
*
|
959
959
|
* const credential = new DeviceCodeCredential({
|
960
|
-
* tenantId: env.AZURE_TENANT_ID,
|
961
|
-
* clientId: env.AZURE_CLIENT_ID,
|
960
|
+
* tenantId: process.env.AZURE_TENANT_ID,
|
961
|
+
* clientId: process.env.AZURE_CLIENT_ID,
|
962
962
|
* userPromptCallback: (info) => {
|
963
963
|
* console.log("CUSTOMIZED PROMPT CALLBACK", info.message);
|
964
|
-
* }
|
964
|
+
* },
|
965
965
|
* });
|
966
966
|
* ```
|
967
967
|
*
|
@@ -1133,14 +1133,14 @@ export declare interface ErrorResponse {
|
|
1133
1133
|
/**
|
1134
1134
|
* Returns a callback that provides a bearer token.
|
1135
1135
|
* For example, the bearer token can be used to authenticate a request as follows:
|
1136
|
-
* ```
|
1137
|
-
* import { DefaultAzureCredential } from "@azure/identity";
|
1136
|
+
* ```ts snippet:token_provider_example
|
1137
|
+
* import { DefaultAzureCredential, getBearerTokenProvider } from "@azure/identity";
|
1138
|
+
* import { createPipelineRequest } from "@azure/core-rest-pipeline";
|
1138
1139
|
*
|
1139
1140
|
* const credential = new DefaultAzureCredential();
|
1140
1141
|
* const scope = "https://cognitiveservices.azure.com/.default";
|
1141
1142
|
* const getAccessToken = getBearerTokenProvider(credential, scope);
|
1142
1143
|
* const token = await getAccessToken();
|
1143
|
-
*
|
1144
1144
|
* // usage
|
1145
1145
|
* const request = createPipelineRequest({ url: "https://example.com" });
|
1146
1146
|
* request.headers.set("Authorization", `Bearer ${token}`);
|
@@ -1344,17 +1344,23 @@ export declare class ManagedIdentityCredential implements TokenCredential {
|
|
1344
1344
|
*/
|
1345
1345
|
constructor(clientId: string, options?: TokenCredentialOptions);
|
1346
1346
|
/**
|
1347
|
-
* Creates an instance of ManagedIdentityCredential with
|
1347
|
+
* Creates an instance of ManagedIdentityCredential with a client ID
|
1348
1348
|
*
|
1349
1349
|
* @param options - Options for configuring the client which makes the access token request.
|
1350
1350
|
*/
|
1351
1351
|
constructor(options?: ManagedIdentityCredentialClientIdOptions);
|
1352
1352
|
/**
|
1353
|
-
* Creates an instance of ManagedIdentityCredential with
|
1353
|
+
* Creates an instance of ManagedIdentityCredential with a resource ID
|
1354
1354
|
*
|
1355
1355
|
* @param options - Options for configuring the resource which makes the access token request.
|
1356
1356
|
*/
|
1357
1357
|
constructor(options?: ManagedIdentityCredentialResourceIdOptions);
|
1358
|
+
/**
|
1359
|
+
* Creates an instance of ManagedIdentityCredential with an object ID
|
1360
|
+
*
|
1361
|
+
* @param options - Options for configuring the resource which makes the access token request.
|
1362
|
+
*/
|
1363
|
+
constructor(options?: ManagedIdentityCredentialObjectIdOptions);
|
1358
1364
|
/**
|
1359
1365
|
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
1360
1366
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
@@ -1378,6 +1384,18 @@ export declare interface ManagedIdentityCredentialClientIdOptions extends TokenC
|
|
1378
1384
|
clientId?: string;
|
1379
1385
|
}
|
1380
1386
|
|
1387
|
+
/**
|
1388
|
+
* Options to send on the {@link ManagedIdentityCredential} constructor.
|
1389
|
+
* This variation supports `objectId` as a constructor argument.
|
1390
|
+
*/
|
1391
|
+
export declare interface ManagedIdentityCredentialObjectIdOptions extends TokenCredentialOptions {
|
1392
|
+
/**
|
1393
|
+
* Allows specifying the object ID of the underlying service principal used to authenticate a user-assigned managed identity.
|
1394
|
+
* This is an alternative to providing a client ID or resource ID and is not required for system-assigned managed identities.
|
1395
|
+
*/
|
1396
|
+
objectId: string;
|
1397
|
+
}
|
1398
|
+
|
1381
1399
|
/**
|
1382
1400
|
* Options to send on the {@link ManagedIdentityCredential} constructor.
|
1383
1401
|
* This variation supports `resourceId` and not `clientId`, since only one of both is supported.
|
@@ -1423,15 +1441,17 @@ export declare class OnBehalfOfCredential implements TokenCredential {
|
|
1423
1441
|
*
|
1424
1442
|
* Example using the `KeyClient` from [\@azure/keyvault-keys](https://www.npmjs.com/package/\@azure/keyvault-keys):
|
1425
1443
|
*
|
1426
|
-
* ```ts
|
1444
|
+
* ```ts snippet:on_behalf_of_credential_pem_example
|
1445
|
+
* import { OnBehalfOfCredential } from "@azure/identity";
|
1446
|
+
* import { KeyClient } from "@azure/keyvault-keys";
|
1447
|
+
*
|
1427
1448
|
* const tokenCredential = new OnBehalfOfCredential({
|
1428
|
-
* tenantId,
|
1429
|
-
* clientId,
|
1449
|
+
* tenantId: "tenant-id",
|
1450
|
+
* clientId: "client-id",
|
1430
1451
|
* certificatePath: "/path/to/certificate.pem",
|
1431
|
-
* userAssertionToken: "access-token"
|
1452
|
+
* userAssertionToken: "access-token",
|
1432
1453
|
* });
|
1433
1454
|
* const client = new KeyClient("vault-url", tokenCredential);
|
1434
|
-
*
|
1435
1455
|
* await client.getKey("key-name");
|
1436
1456
|
* ```
|
1437
1457
|
*
|
@@ -1445,15 +1465,17 @@ export declare class OnBehalfOfCredential implements TokenCredential {
|
|
1445
1465
|
*
|
1446
1466
|
* Example using the `KeyClient` from [\@azure/keyvault-keys](https://www.npmjs.com/package/\@azure/keyvault-keys):
|
1447
1467
|
*
|
1448
|
-
* ```ts
|
1468
|
+
* ```ts snippet:on_behalf_of_credential_secret_example
|
1469
|
+
* import { OnBehalfOfCredential } from "@azure/identity";
|
1470
|
+
* import { KeyClient } from "@azure/keyvault-keys";
|
1471
|
+
*
|
1449
1472
|
* const tokenCredential = new OnBehalfOfCredential({
|
1450
|
-
* tenantId,
|
1451
|
-
* clientId,
|
1452
|
-
* clientSecret,
|
1453
|
-
* userAssertionToken: "access-token"
|
1473
|
+
* tenantId: "tenant-id",
|
1474
|
+
* clientId: "client-id",
|
1475
|
+
* clientSecret: "client-secret",
|
1476
|
+
* userAssertionToken: "access-token",
|
1454
1477
|
* });
|
1455
1478
|
* const client = new KeyClient("vault-url", tokenCredential);
|
1456
|
-
*
|
1457
1479
|
* await client.getKey("key-name");
|
1458
1480
|
* ```
|
1459
1481
|
*
|
@@ -1467,15 +1489,19 @@ export declare class OnBehalfOfCredential implements TokenCredential {
|
|
1467
1489
|
*
|
1468
1490
|
* Example using the `KeyClient` from [\@azure/keyvault-keys](https://www.npmjs.com/package/\@azure/keyvault-keys):
|
1469
1491
|
*
|
1470
|
-
* ```ts
|
1492
|
+
* ```ts snippet:on_behalf_of_credential_assertion_example
|
1493
|
+
* import { OnBehalfOfCredential } from "@azure/identity";
|
1494
|
+
* import { KeyClient } from "@azure/keyvault-keys";
|
1495
|
+
*
|
1471
1496
|
* const tokenCredential = new OnBehalfOfCredential({
|
1472
|
-
* tenantId,
|
1473
|
-
* clientId,
|
1474
|
-
* getAssertion: () => {
|
1475
|
-
*
|
1497
|
+
* tenantId: "tenant-id",
|
1498
|
+
* clientId: "client-id",
|
1499
|
+
* getAssertion: () => {
|
1500
|
+
* return Promise.resolve("my-jwt");
|
1501
|
+
* },
|
1502
|
+
* userAssertionToken: "access-token",
|
1476
1503
|
* });
|
1477
1504
|
* const client = new KeyClient("vault-url", tokenCredential);
|
1478
|
-
*
|
1479
1505
|
* await client.getKey("key-name");
|
1480
1506
|
* ```
|
1481
1507
|
*
|
@@ -1648,18 +1674,16 @@ export declare interface TokenCredentialOptions extends CommonClientOptions {
|
|
1648
1674
|
*
|
1649
1675
|
* Example:
|
1650
1676
|
*
|
1651
|
-
* ```
|
1652
|
-
* import {
|
1677
|
+
* ```ts snippet:consumer_example
|
1678
|
+
* import { useIdentityPlugin, DeviceCodeCredential } from "@azure/identity";
|
1653
1679
|
*
|
1654
|
-
* import { useIdentityPlugin, DefaultAzureCredential } from "@azure/identity";
|
1655
1680
|
* useIdentityPlugin(cachePersistencePlugin);
|
1656
|
-
*
|
1657
|
-
* // The plugin has the capability to extend `DefaultAzureCredential` and to
|
1681
|
+
* // The plugin has the capability to extend `DeviceCodeCredential` and to
|
1658
1682
|
* // add middleware to the underlying credentials, such as persistence.
|
1659
|
-
* const credential = new
|
1683
|
+
* const credential = new DeviceCodeCredential({
|
1660
1684
|
* tokenCachePersistenceOptions: {
|
1661
|
-
* enabled: true
|
1662
|
-
* }
|
1685
|
+
* enabled: true,
|
1686
|
+
* },
|
1663
1687
|
* });
|
1664
1688
|
* ```
|
1665
1689
|
*
|