@@ -698,8 +698,8 @@ public override string ServerVersion
698
698
{
699
699
get
700
700
{
701
- return ( string . Format ( "{0:00}.{1:00}.{2:0000}" , _loginAck . MajorVersion ,
702
- ( short ) _loginAck . MinorVersion , _loginAck . BuildNum ) ) ;
701
+ return ( string . Format ( "{0:00}.{1:00}.{2:0000}" , _loginAck . majorVersion ,
702
+ ( short ) _loginAck . minorVersion , _loginAck . buildNum ) ) ;
703
703
}
704
704
}
705
705
@@ -722,7 +722,7 @@ protected override bool UnbindOnTransactionCompletion
722
722
/// <summary>
723
723
/// Validates if federated authentication is used, Access Token used by this connection is active for the value of 'accessTokenExpirationBufferTime'.
724
724
/// </summary>
725
- internal override bool IsAccessTokenExpired => _federatedAuthenticationInfoRequested && DateTime . FromFileTimeUtc ( _fedAuthToken . ExpirationFileTime ) < DateTime . UtcNow . AddSeconds ( accessTokenExpirationBufferTime ) ;
725
+ internal override bool IsAccessTokenExpired => _federatedAuthenticationInfoRequested && DateTime . FromFileTimeUtc ( _fedAuthToken . expirationFileTime ) < DateTime . UtcNow . AddSeconds ( accessTokenExpirationBufferTime ) ;
726
726
727
727
////////////////////////////////////////////////////////////////////////////////////////
728
728
// GENERAL METHODS
@@ -1278,37 +1278,37 @@ private void Login(ServerInfo server, TimeoutTimer timeout, string newPassword,
1278
1278
}
1279
1279
}
1280
1280
1281
- login . Authentication = ConnectionOptions . Authentication ;
1282
- login . Timeout = timeoutInSeconds ;
1283
- login . UserInstance = ConnectionOptions . UserInstance ;
1284
- login . HostName = ConnectionOptions . ObtainWorkstationId ( ) ;
1285
- login . UserName = ConnectionOptions . UserID ;
1286
- login . Password = ConnectionOptions . Password ;
1287
- login . ApplicationName = ConnectionOptions . ApplicationName ;
1281
+ login . authentication = ConnectionOptions . Authentication ;
1282
+ login . timeout = timeoutInSeconds ;
1283
+ login . userInstance = ConnectionOptions . UserInstance ;
1284
+ login . hostName = ConnectionOptions . ObtainWorkstationId ( ) ;
1285
+ login . userName = ConnectionOptions . UserID ;
1286
+ login . password = ConnectionOptions . Password ;
1287
+ login . applicationName = ConnectionOptions . ApplicationName ;
1288
1288
1289
- login . Language = _currentLanguage ;
1290
- if ( ! login . UserInstance )
1289
+ login . language = _currentLanguage ;
1290
+ if ( ! login . userInstance )
1291
1291
{
1292
1292
// Do not send attachdbfilename or database to SSE primary instance
1293
- login . Database = CurrentDatabase ;
1294
- login . AttachDbFilename = ConnectionOptions . AttachDBFilename ;
1293
+ login . database = CurrentDatabase ;
1294
+ login . attachDBFilename = ConnectionOptions . AttachDBFilename ;
1295
1295
}
1296
1296
1297
1297
// VSTS#795621 - Ensure ServerName is Sent During TdsLogin To Enable Sql Azure Connectivity.
1298
1298
// Using server.UserServerName (versus ConnectionOptions.DataSource) since TdsLogin requires
1299
1299
// serverName to always be non-null.
1300
- login . ServerName = server . UserServerName ;
1300
+ login . serverName = server . UserServerName ;
1301
1301
1302
- login . UseReplication = ConnectionOptions . Replication ;
1303
- login . UseSspi = ConnectionOptions . IntegratedSecurity // Treat AD Integrated like Windows integrated when against a non-FedAuth endpoint
1302
+ login . useReplication = ConnectionOptions . Replication ;
1303
+ login . useSSPI = ConnectionOptions . IntegratedSecurity // Treat AD Integrated like Windows integrated when against a non-FedAuth endpoint
1304
1304
|| ( ConnectionOptions . Authentication == SqlAuthenticationMethod . ActiveDirectoryIntegrated && ! _fedAuthRequired ) ;
1305
- login . PacketSize = _currentPacketSize ;
1306
- login . NewPassword = newPassword ;
1307
- login . ReadOnlyIntent = ConnectionOptions . ApplicationIntent == ApplicationIntent . ReadOnly ;
1308
- login . Credential = _credential ;
1305
+ login . packetSize = _currentPacketSize ;
1306
+ login . newPassword = newPassword ;
1307
+ login . readOnlyIntent = ConnectionOptions . ApplicationIntent == ApplicationIntent . ReadOnly ;
1308
+ login . credential = _credential ;
1309
1309
if ( newSecurePassword != null )
1310
1310
{
1311
- login . NewSecurePassword = newSecurePassword ;
1311
+ login . newSecurePassword = newSecurePassword ;
1312
1312
}
1313
1313
1314
1314
TdsEnums . FeatureExtension requestedFeatures = TdsEnums . FeatureExtension . None ;
@@ -1338,9 +1338,9 @@ private void Login(ServerInfo server, TimeoutTimer timeout, string newPassword,
1338
1338
_fedAuthFeatureExtensionData =
1339
1339
new FederatedAuthenticationFeatureExtensionData
1340
1340
{
1341
- LibraryType = TdsEnums . FedAuthLibrary . MSAL ,
1342
- Authentication = ConnectionOptions . Authentication ,
1343
- FedAuthRequiredPreLoginResponse = _fedAuthRequired
1341
+ libraryType = TdsEnums . FedAuthLibrary . MSAL ,
1342
+ authentication = ConnectionOptions . Authentication ,
1343
+ fedAuthRequiredPreLoginResponse = _fedAuthRequired
1344
1344
} ;
1345
1345
}
1346
1346
@@ -1349,9 +1349,9 @@ private void Login(ServerInfo server, TimeoutTimer timeout, string newPassword,
1349
1349
requestedFeatures |= TdsEnums . FeatureExtension . FedAuth ;
1350
1350
_fedAuthFeatureExtensionData = new FederatedAuthenticationFeatureExtensionData
1351
1351
{
1352
- LibraryType = TdsEnums . FedAuthLibrary . SecurityToken ,
1353
- FedAuthRequiredPreLoginResponse = _fedAuthRequired ,
1354
- AccessToken = _accessTokenInBytes
1352
+ libraryType = TdsEnums . FedAuthLibrary . SecurityToken ,
1353
+ fedAuthRequiredPreLoginResponse = _fedAuthRequired ,
1354
+ accessToken = _accessTokenInBytes
1355
1355
} ;
1356
1356
// No need any further info from the server for token based authentication. So set _federatedAuthenticationRequested to true
1357
1357
_federatedAuthenticationRequested = true ;
@@ -2134,14 +2134,14 @@ internal void OnLoginAck(SqlLoginAck rec)
2134
2134
_loginAck = rec ;
2135
2135
if ( _recoverySessionData != null )
2136
2136
{
2137
- if ( _recoverySessionData . _tdsVersion != rec . TdsVersion )
2137
+ if ( _recoverySessionData . _tdsVersion != rec . tdsVersion )
2138
2138
{
2139
2139
throw SQL . CR_TDSVersionNotPreserved ( this ) ;
2140
2140
}
2141
2141
}
2142
2142
if ( _currentSessionData != null )
2143
2143
{
2144
- _currentSessionData . _tdsVersion = rec . TdsVersion ;
2144
+ _currentSessionData . _tdsVersion = rec . tdsVersion ;
2145
2145
}
2146
2146
}
2147
2147
@@ -2179,7 +2179,7 @@ internal void OnFedAuthInfo(SqlFedAuthInfo fedAuthInfo)
2179
2179
Debug . Assert ( _dbConnectionPool . AuthenticationContexts != null ) ;
2180
2180
2181
2181
// Construct the dbAuthenticationContextKey with information from FedAuthInfo and store for later use, when inserting in to the token cache.
2182
- _dbConnectionPoolAuthenticationContextKey = new DbConnectionPoolAuthenticationContextKey ( fedAuthInfo . StsUrl , fedAuthInfo . Spn ) ;
2182
+ _dbConnectionPoolAuthenticationContextKey = new DbConnectionPoolAuthenticationContextKey ( fedAuthInfo . stsurl , fedAuthInfo . spn ) ;
2183
2183
2184
2184
// Try to retrieve the authentication context from the pool, if one does exist for this key.
2185
2185
if ( _dbConnectionPool . AuthenticationContexts . TryGetValue ( _dbConnectionPoolAuthenticationContextKey , out dbConnectionPoolAuthenticationContext ) )
@@ -2272,11 +2272,11 @@ internal void OnFedAuthInfo(SqlFedAuthInfo fedAuthInfo)
2272
2272
2273
2273
// If the code flow is here, then we are re-using the context from the cache for this connection attempt and not
2274
2274
// generating a new access token on this thread.
2275
- _fedAuthToken . AccessToken = dbConnectionPoolAuthenticationContext . AccessToken ;
2276
- _fedAuthToken . ExpirationFileTime = dbConnectionPoolAuthenticationContext . ExpirationTime . ToFileTime ( ) ;
2275
+ _fedAuthToken . accessToken = dbConnectionPoolAuthenticationContext . AccessToken ;
2276
+ _fedAuthToken . expirationFileTime = dbConnectionPoolAuthenticationContext . ExpirationTime . ToFileTime ( ) ;
2277
2277
}
2278
2278
2279
- Debug . Assert ( _fedAuthToken != null && _fedAuthToken . AccessToken != null , "fedAuthToken and fedAuthToken.accessToken cannot be null." ) ;
2279
+ Debug . Assert ( _fedAuthToken != null && _fedAuthToken . accessToken != null , "fedAuthToken and fedAuthToken.accessToken cannot be null." ) ;
2280
2280
_parser . SendFedAuthToken ( _fedAuthToken ) ;
2281
2281
}
2282
2282
@@ -2374,8 +2374,8 @@ internal SqlFedAuthToken GetFedAuthToken(SqlFedAuthInfo fedAuthInfo)
2374
2374
{
2375
2375
var authParamsBuilder = new SqlAuthenticationParameters . Builder (
2376
2376
authenticationMethod : ConnectionOptions . Authentication ,
2377
- resource : fedAuthInfo . Spn ,
2378
- authority : fedAuthInfo . StsUrl ,
2377
+ resource : fedAuthInfo . spn ,
2378
+ authority : fedAuthInfo . stsurl ,
2379
2379
serverName : ConnectionOptions . DataSource ,
2380
2380
databaseName : ConnectionOptions . InitialCatalog )
2381
2381
. WithConnectionId ( _clientConnectionId )
@@ -2482,7 +2482,7 @@ internal SqlFedAuthToken GetFedAuthToken(SqlFedAuthInfo fedAuthInfo)
2482
2482
break ;
2483
2483
}
2484
2484
2485
- Debug . Assert ( _fedAuthToken . AccessToken != null , "AccessToken should not be null." ) ;
2485
+ Debug . Assert ( _fedAuthToken . accessToken != null , "AccessToken should not be null." ) ;
2486
2486
#ifDEBUG
2487
2487
if ( _forceMsalRetry )
2488
2488
{
@@ -2569,13 +2569,13 @@ internal SqlFedAuthToken GetFedAuthToken(SqlFedAuthInfo fedAuthInfo)
2569
2569
}
2570
2570
2571
2571
Debug . Assert ( _fedAuthToken != null , "fedAuthToken should not be null." ) ;
2572
- Debug . Assert ( _fedAuthToken . AccessToken != null && _fedAuthToken . AccessToken . Length > 0 , "fedAuthToken.accessToken should not be null or empty." ) ;
2572
+ Debug . Assert ( _fedAuthToken . accessToken != null && _fedAuthToken . accessToken . Length > 0 , "fedAuthToken.accessToken should not be null or empty." ) ;
2573
2573
2574
2574
// Store the newly generated token in _newDbConnectionPoolAuthenticationContext, only if using pooling.
2575
2575
if ( _dbConnectionPool != null )
2576
2576
{
2577
- DateTime expirationTime = DateTime . FromFileTimeUtc ( _fedAuthToken . ExpirationFileTime ) ;
2578
- _newDbConnectionPoolAuthenticationContext = new DbConnectionPoolAuthenticationContext ( _fedAuthToken . AccessToken , expirationTime ) ;
2577
+ DateTime expirationTime = DateTime . FromFileTimeUtc ( _fedAuthToken . expirationFileTime ) ;
2578
+ _newDbConnectionPoolAuthenticationContext = new DbConnectionPoolAuthenticationContext ( _fedAuthToken . accessToken , expirationTime ) ;
2579
2579
}
2580
2580
SqlClientEventSource . Log . TryTraceEvent ( "<sc.SqlInternalConnectionTds.GetFedAuthToken> {0}, Finished generating federated authentication token." , ObjectID ) ;
2581
2581
return _fedAuthToken ;
@@ -2667,7 +2667,7 @@ internal void OnFeatureExtAck(int featureId, byte[] data)
2667
2667
2668
2668
Debug . Assert ( _fedAuthFeatureExtensionData != null , "_fedAuthFeatureExtensionData must not be null when _federatedAuthenticationRequested == true" ) ;
2669
2669
2670
- switch ( _fedAuthFeatureExtensionData . LibraryType )
2670
+ switch ( _fedAuthFeatureExtensionData . libraryType )
2671
2671
{
2672
2672
case TdsEnums . FedAuthLibrary . MSAL :
2673
2673
case TdsEnums . FedAuthLibrary . SecurityToken :
@@ -2682,7 +2682,7 @@ internal void OnFeatureExtAck(int featureId, byte[] data)
2682
2682
default :
2683
2683
Debug . Fail ( "Unknown _fedAuthLibrary type" ) ;
2684
2684
SqlClientEventSource . Log . TryTraceEvent ( "<sc.SqlInternalConnectionTds.OnFeatureExtAck|ERR> {0}, Attempting to use unknown federated authentication library" , ObjectID ) ;
2685
- throw SQL . ParsingErrorLibraryType ( ParsingErrorState . FedAuthFeatureAckUnknownLibraryType , ( int ) _fedAuthFeatureExtensionData . LibraryType ) ;
2685
+ throw SQL . ParsingErrorLibraryType ( ParsingErrorState . FedAuthFeatureAckUnknownLibraryType , ( int ) _fedAuthFeatureExtensionData . libraryType ) ;
2686
2686
}
2687
2687
_federatedAuthenticationAcknowledged = true ;
2688
2688