@azure/identity
Advanced tools
Comparing version 4.5.0-alpha.20241004.1 to 4.5.0-alpha.20241007.2
@@ -6,3 +6,3 @@ // Copyright (c) Microsoft Corporation. | ||
*/ | ||
export const SDK_VERSION = `4.5.0-beta.3`; | ||
export const SDK_VERSION = `4.5.0`; | ||
/** | ||
@@ -9,0 +9,0 @@ * The default client ID for authentication |
@@ -25,3 +25,4 @@ // Copyright (c) Microsoft Corporation. | ||
*/ | ||
constructor(tenantId, clientId, serviceConnectionId, systemAccessToken, options) { | ||
constructor(tenantId, clientId, serviceConnectionId, systemAccessToken, options = {}) { | ||
var _a, _b; | ||
if (!clientId) { | ||
@@ -39,2 +40,8 @@ throw new CredentialUnavailableError(`${credentialName}: is unavailable. clientId is a required parameter.`); | ||
} | ||
// Allow these headers to be logged for troubleshooting by AzurePipelines. | ||
options.loggingOptions = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.loggingOptions), { additionalAllowedHeaderNames: [ | ||
...((_b = (_a = options.loggingOptions) === null || _a === void 0 ? void 0 : _a.additionalAllowedHeaderNames) !== null && _b !== void 0 ? _b : []), | ||
"x-vss-e2eid", | ||
"x-msedge-ref", | ||
] }); | ||
this.identityClient = new IdentityClient(options); | ||
@@ -88,2 +95,4 @@ checkTenantId(logger, tenantId); | ||
Authorization: `Bearer ${systemAccessToken}`, | ||
// Prevents the service from responding with a redirect HTTP status code (useful for automation). | ||
"X-TFS-FedAuthRedirect": "Suppress", | ||
}), | ||
@@ -96,2 +105,3 @@ }); | ||
export function handleOidcResponse(response) { | ||
// OIDC token is present in `bodyAsText` field | ||
const text = response.bodyAsText; | ||
@@ -114,3 +124,3 @@ if (!text) { | ||
if (response.status !== 200) { | ||
errorDescription = `Complete response - ${JSON.stringify(result)}. See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/azurepipelinescredential/troubleshoot`; | ||
errorDescription = `Response body = ${text}. Response Headers ["x-vss-e2eid"] = ${response.headers.get("x-vss-e2eid")} and ["x-msedge-ref"] = ${response.headers.get("x-msedge-ref")}. See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/azurepipelinescredential/troubleshoot`; | ||
} | ||
@@ -127,7 +137,8 @@ logger.error(errorMessage); | ||
const errorDetails = `${credentialName}: Authentication Failed. oidcToken field not detected in the response.`; | ||
logger.error(`Response from service = ${text} and error message = ${e.message}`); | ||
logger.error(`Response from service = ${text}, Response Headers ["x-vss-e2eid"] = ${response.headers.get("x-vss-e2eid")} | ||
and ["x-msedge-ref"] = ${response.headers.get("x-msedge-ref")}, error message = ${e.message}`); | ||
logger.error(errorDetails); | ||
throw new AuthenticationError(response.status, { | ||
error: errorDetails, | ||
error_description: `Response = ${text}. See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/azurepipelinescredential/troubleshoot`, | ||
error_description: `Response = ${text}. Response headers ["x-vss-e2eid"] = ${response.headers.get("x-vss-e2eid")} and ["x-msedge-ref"] = ${response.headers.get("x-msedge-ref")}. See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/azurepipelinescredential/troubleshoot`, | ||
}); | ||
@@ -134,0 +145,0 @@ } |
@@ -163,3 +163,4 @@ // Copyright (c) Microsoft Corporation. | ||
error.name === "BrowserConfigurationAuthError" || | ||
error.name === "AbortError") { | ||
error.name === "AbortError" || | ||
error.name === "AuthenticationError") { | ||
return error; | ||
@@ -166,0 +167,0 @@ } |
{ | ||
"name": "@azure/identity", | ||
"sdk-type": "client", | ||
"version": "4.5.0-alpha.20241004.1", | ||
"version": "4.5.0-alpha.20241007.2", | ||
"description": "Provides credential implementations for Azure SDK libraries that can authenticate with Microsoft Entra ID", | ||
@@ -6,0 +6,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1580131
12015