@@ -1749,22 +1749,22 @@ await Task.Factory.StartNew(() => Task.Run(async () => {
17491749 public ConnectionDetails ParseConnectionString ( string connectionString )
17501750 {
17511751 SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder ( connectionString ) ;
1752- bool isAzureMFA = builder . Authentication == SqlAuthenticationMethod . ActiveDirectoryInteractive ; // Azure Multi-Factor Authentication
1753- bool isSqlLogin = builder . Authentication == SqlAuthenticationMethod . SqlPassword ; // SQL username/password
1754- bool isIntegrated = builder . IntegratedSecurity ; // Windows Integrated Security
1755- string Authenticationtype = null ;
17561752
1757- if ( isAzureMFA )
1753+ string mappedAuthenticationType ;
1754+ if ( builder . IntegratedSecurity )
17581755 {
1759- Authenticationtype = "AzureMFA" ;
1756+ mappedAuthenticationType = "Integrated" ;
1757+ } else if ( builder . Authentication == SqlAuthenticationMethod . ActiveDirectoryInteractive )
1758+ {
1759+ mappedAuthenticationType = "AzureMFA" ;
17601760 }
1761- else if ( isSqlLogin )
1761+ else if ( builder . Authentication == SqlAuthenticationMethod . SqlPassword || builder . Authentication == SqlAuthenticationMethod . NotSpecified )
17621762 {
1763- Authenticationtype = "SqlLogin" ;
1763+ mappedAuthenticationType = "SqlLogin" ;
17641764 }
1765- else if ( isIntegrated )
1765+ else
17661766 {
1767- Authenticationtype = "Integrated" ;
1767+ mappedAuthenticationType = builder . Authentication . ToString ( ) ;
17681768 }
17691769
17701770 // Set defaults as per MSSQL connection property defaults, not SqlClient's Connection string buider defaults
@@ -1773,7 +1773,7 @@ public ConnectionDetails ParseConnectionString(string connectionString)
17731773 ApplicationIntent = defaultBuilder . ApplicationIntent != builder . ApplicationIntent ? builder . ApplicationIntent . ToString ( ) : null ,
17741774 ApplicationName = defaultBuilder . ApplicationName != builder . ApplicationName ? builder . ApplicationName : ApplicationName ,
17751775 AttachDbFilename = defaultBuilder . AttachDBFilename != builder . AttachDBFilename ? builder . AttachDBFilename . ToString ( ) : null ,
1776- AuthenticationType = Authenticationtype ,
1776+ AuthenticationType = mappedAuthenticationType ,
17771777 ConnectRetryCount = defaultBuilder . ConnectRetryCount != builder . ConnectRetryCount ? builder . ConnectRetryCount : 1 ,
17781778 ConnectRetryInterval = defaultBuilder . ConnectRetryInterval != builder . ConnectRetryInterval ? builder . ConnectRetryInterval : 10 ,
17791779 ConnectTimeout = defaultBuilder . ConnectTimeout != builder . ConnectTimeout ? builder . ConnectTimeout : 30 ,
0 commit comments