Skip to content

[Bug]: "MS SQL: Add Microsoft Entra Account" hangs on localhost callback and fails token redemption with ClientAuthError: network_error (macOS arm64, VS Code 1.109.5) #21356

@Michael9094

Description

@Michael9094

Description

Expected the MSSQL extension to successfully add my Microsoft Entra account after completing the interactive browser login flow, and then allow me to connect using Microsoft Entra ID – Universal with MFA support.

But what actually happened was: the browser completes sign-in and navigates to a localhost callback URL like http://127.0.0.1:/callback?code=... and then hangs "waiting for a response". In the MSSQL-Azure Auth logs, the extension calls acquireTokenByCode and then fails while posting to the token endpoint with:

ClientAuthError: network_error: Network request failed

Despite this, the logs sometimes show Account added successfully. but no usable account is added, and the flow never completes.

Steps to Reproduce

  1. On macOS (Apple Silicon), open VS Code.
  2. Install/enable SQL Server (mssql) extension.
  3. Run command palette: MS SQL: Add Microsoft Entra Account.
  4. A browser window opens to https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize.
  5. Select an Entra account and complete sign-in.
  6. Browser redirects to http://127.0.0.1:/callback?code=... and hangs indefinitely.
  7. VS Code logs show acquireTokenByCode followed by network_error: Network request failed.

Affected Area

  • Connection dialog (SQL Server | Azure browse/Fabric browse)
  • Query editor
  • Query results panel
  • Object Explorer
  • GitHub Copilot integration
  • Preview/Edit data
  • Table Designer
  • Schema Designer
  • Schema Compare
  • Local SQL Server Container provisioning
  • SQL database in Fabric provisioning
  • DACPAC/BACPAC export/import
  • SQL Database projects
  • Query Plan Visualizer
  • Other (please describe below)

If you selected "Other", please describe the affected area

No response

Environment Information

MSSQL Extension: Version 1.40.0
VS Code Version: 1.109.5 (Universal)
Commit: 072586267e68ece9a47aa43f8c108e0dcbf44622
Date: 2026-02-19T19:43:32.382Z
Electron: 39.3.0
ElectronBuildId: 13313481
Chromium: 142.0.7444.265
Node.js: 22.21.1
V8: 14.2.231.22-electron.0
OS: Darwin arm64 25.3.0
Connection Type: Azure SQL

Confirmation

  • I have searched existing issues and couldn't find a match
  • I want to work on this issue

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions