Skip to content

7.0.2 regression: Active Directory Interactive authentication opens non-browser window after 60+ second delay (worked in 7.0.1) #4414

Closed as not planned

Description

@ZeBobo5

Describe the bug

When using Authentication=Active Directory Interactive in the connection string, upgrading from Microsoft.Data.SqlClient 7.0.1 to 7.0.2 causes a regression in the interactive authentication flow:

  • 7.0.1: The sign-in prompt opens in the default browser (web-based flow).
  • 7.0.2: The sign-in prompt opens in a non-browser embedded window (native dialog), and only appears after an extremely long delay, over one minute, before the dialog eventually shows up.

This delay makes the application appear completely frozen. No exception is thrown; the dialog does eventually appear, but the wait is unreasonable and was not present in 7.0.1.

No exception is thrown.

To reproduce

using Microsoft.Data.SqlClient;

var connectionString = "Server=myserver.database.windows.net;Database=mydb;Authentication=Active Directory Interactive;";

using var connection = new SqlConnection(connectionString);
connection.Open(); // Hangs for 60+ seconds before showing the sign-in window (non-browser)

Steps:

  1. Create a .NET application using Microsoft.Data.SqlClient 7.0.2.
  2. Use a connection string with Authentication=Active Directory Interactive.
  3. Call connection.Open().
  4. Observe that the sign-in dialog appears in a native window (not the browser) after a delay of over one minute.
  5. Downgrade to 7.0.1 and repeat, the prompt opens in the browser almost immediately.

Expected behavior

The interactive authentication flow should behave as in 7.0.1:

  • Open the sign-in prompt in the default browser (web-based MSAL flow).
  • Show the prompt within a reasonable timeframe (a few seconds), not after 60+ seconds.

Further technical details

  • Microsoft.Data.SqlClient version: 7.0.2 (regression from 7.0.1)
  • .NET target: .NET 10.0
  • SQL Server version: Azure SQL Database
  • Operating system: Windows

Additional context

  • The issue is not an exception, the dialog does eventually appear, but the 60+ second delay makes it feel like a hang or timeout.
  • This is a breaking behavioral change in a patch version (7.0.1 → 7.0.2).

Activity

  1. changed the title [-]**7.0.2 regression: `Active Directory Interactive` authentication opens non-browser window after 60+ second delay (worked in 7.0.1)**[/-] [+]7.0.2 regression: `Active Directory Interactive` authentication opens non-browser window after 60+ second delay (worked in 7.0.1)[/+] on Jun 29, 2026
  2. github-actions commented on Jun 29, 2026

    @github-actions

    🔍 Triage Summary

    Check Result
    Issue type Bug
    Environment All required environment details provided for investigation
    Area Area\Azure Connectivity
    Duplicates Potentially related: #2611 (feature request for embedded vs system browser choice)
    Regression Likely regression from 7.0.1 → 7.0.2

    Analysis

    This issue reports a clear behavioral regression in the ActiveDirectoryInteractive authentication flow between 7.0.1 and 7.0.2: the sign-in prompt switched from opening in the system browser to an embedded/native window, accompanied by a 60+ second delay before the dialog appears. The affected component is ActiveDirectoryAuthenticationProvider and its MSAL (Microsoft.Identity.Client) integration — specifically the AcquireTokenInteractive call and whether WithUseEmbeddedWebView (or equivalent) is now being set differently. This is a P1 regression since it meaningfully degrades the interactive auth UX in a patch release.

    Next Steps

    • Assign to Copilot coding agent to investigate the diff between 7.0.1 and 7.0.2 in ActiveDirectoryAuthenticationProvider.cs — specifically any changes to AcquireTokenInteractive builder options (e.g. WithUseEmbeddedWebView, WithParentActivityOrWindow, or WithSystemWebViewOptions) and any MSAL package version bump that may have changed the default web view behavior.
    • Bisect the 7.0.2 release commits to identify which change introduced the regression (check release notes / changelog for 7.0.2 authentication-related entries).
    • Confirm whether the Microsoft.Identity.Client dependency version changed between 7.0.1 and 7.0.2, as MSAL itself may have altered its default embedded/system browser selection logic.
    • Cross-reference with Provide an option for embedded or system browser with Azure interactive authentication #2611 which previously documented that the embedded vs system browser choice depends on MSAL defaults and .NET version.

    Note: This triage summary is auto-generated by an AI agent. The analysis and suggestions above have not been verified by a human maintainer. Please treat as preliminary guidance only.

    Generated by SqlClient Issue Auto-Triage for issue #4414 · 34.4 AIC · ⌖ 6.95 AIC · ⊞ 8.4K · ◷

  3. mdaigle commented on Jul 1, 2026

    @mdaigle
    Contributor

    Hi @ZeBobo5, the behavior you're seeing is due to the Web Account Manager (WAM). We don't have control over the timing or format of the popup window, that's all down to MSAL. In our testing, the WAM popup appeared just as quickly as the browser used to. We were required to enable this behavior for our Microsoft first party Entra ID application, so we won't be able to provide a path to use the first party app without WAM. WAM will provide a more secure token caching and management experience so I would recommend that you leave it enabled if the experience is acceptable.

    Otherwise, you do have a few options to circumvent WAM:
    A. Create your own Entra ID application and pass its app id to us as config. We do not enable WAM for customer Entra ID apps.

    var options = new ActiveDirectoryAuthenticationProviderOptions
    {
        ApplicationClientId = "<your-app-client-id>",
        UseWamBroker = true, // Windows only
    };
    var provider = new ActiveDirectoryAuthenticationProvider(options);
    SqlAuthenticationProvider.SetProvider(SqlAuthenticationMethod.ActiveDirectoryInteractive, provider);

    B. Create a custom SqlAuthenticationProvider or provide an auth token callback function. I discuss these options in more detail here: #4410 (comment). This option also lets you avoid the added size of the new dependency required to enable WAM.

  4. added
    Area\Azure Connectivity
    on Jul 9, 2026
  5. moved this from To triage to Waiting for customer in SqlClient Boardon Jul 9, 2026
  6. cheenamalhotra commented on Jul 9, 2026

    @cheenamalhotra
    Member

    Closing as a no-op.

  7. moved this from Waiting for customer to Done in SqlClient Boardon Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area\Azure Connectivity

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions