Skip to content

feat: add ADO.Net Authentication connection string synonym and spaced value names#368

Open
dlevy-msft-sql wants to merge 2 commits into
microsoft:mainfrom
dlevy-msft-sql:feat/ado-net-auth-synonyms
Open

feat: add ADO.Net Authentication connection string synonym and spaced value names#368
dlevy-msft-sql wants to merge 2 commits into
microsoft:mainfrom
dlevy-msft-sql:feat/ado-net-auth-synonyms

Conversation

@dlevy-msft-sql

Copy link
Copy Markdown

Problem

Users coming from ADO.Net expect to use Authentication=Active Directory Default style connection strings, but the driver only supports fedauth=ActiveDirectoryDefault.

Fix

1. Connection string synonym

Added "authentication" as a synonym for "fedauth" in the ADO-style connection string parser (msdsn/conn_str.go).

2. ADO.Net-style value names

Added support for spaced authentication values in the azuread package, matching ADO.Net SqlClient names:

ADO.Net Value Maps To
Sql Password Standard SQL auth (no fedauth)
Active Directory Password ActiveDirectoryPassword
Active Directory Integrated ActiveDirectoryIntegrated
Active Directory Interactive ActiveDirectoryInteractive
Active Directory Service Principal ActiveDirectoryServicePrincipal
Active Directory Device Code Flow ActiveDirectoryDeviceCode
Active Directory Managed Identity ActiveDirectoryManagedIdentity
Active Directory MSI ActiveDirectoryMSI
Active Directory Default ActiveDirectoryDefault
Active Directory Workload Identity ActiveDirectoryWorkloadIdentity

Examples

These connection strings are now equivalent:

fedauth=ActiveDirectoryDefault
Authentication=ActiveDirectoryDefault
Authentication=Active Directory Default

Tests

Added 4 test cases to TestValidateParameters:

  • Authentication synonym with existing value name
  • Active Directory Password spaced name
  • Active Directory Managed Identity spaced name
  • Sql Password returns no fedauth config

All existing tests pass.

Fixes #288

@dlevy-msft-sql dlevy-msft-sql added this to the v1.11.0 milestone Apr 17, 2026
@codecov-commenter

codecov-commenter commented Apr 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.60%. Comparing base (c10fa99) to head (cf4e65d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main     #368       +/-   ##
===========================================
+ Coverage   80.66%   96.60%   +15.93%     
===========================================
  Files          35       92       +57     
  Lines        6842    74355    +67513     
===========================================
+ Hits         5519    71828    +66309     
- Misses       1055     2191     +1136     
- Partials      268      336       +68     
Flag Coverage Δ
unittests 96.53% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
azuread/configuration.go 52.34% <100.00%> (ø)
msdsn/conn_str.go 90.08% <ø> (ø)

... and 57 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dlevy-msft-sql dlevy-msft-sql force-pushed the feat/ado-net-auth-synonyms branch 2 times, most recently from f8cd298 to cf87270 Compare April 24, 2026 21:04
Map matches exact string constants from Microsoft.Data.SqlClient's
DbConnectionStringUtilities (e.g. 'Active Directory Password').
Only includes values defined in the ADO.NET SqlAuthenticationMethod enum.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds ADO.Net-compatible authentication naming to the Go MSSQL driver’s connection-string handling, improving migration ergonomics for users coming from Microsoft.Data.SqlClient.

Changes:

  • Add Authentication as an ADO-style keyword synonym for fedauth in msdsn parsing.
  • Normalize ADO.Net “spaced” authentication method values (e.g., Active Directory Default) to the driver’s existing ActiveDirectoryDefault-style values in azuread.
  • Extend azuread unit tests to cover the new synonym and spaced value mappings (including Sql Password meaning “no fedauth”).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
msdsn/conn_str.go Adds authentication -> fedauth keyword synonym in ADO-style DSN parsing.
azuread/configuration.go Adds mapping table + normalization step for ADO.Net spaced Authentication values.
azuread/configuration_test.go Adds test cases validating synonym + spaced value support, including Sql Password behavior.

Comment thread msdsn/conn_str.go

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add more ADO.Net synonyms to connection string parameters

3 participants