Skip to content

Commit 567ae6e

Browse files
authored
Fix clientSecret is null or empty for ActiveDirectoryServicePrincipal in Azure container (#1519)
1 parent 8a67084 commit 567ae6e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2766,8 +2766,6 @@ private InetSocketAddress connectHelper(ServerPortPlaceHolder serverInfo, int ti
27662766

27672767
// We have successfully connected, now do the login. logon takes seconds timeout
27682768
executeCommand(new LogonCommand());
2769-
aadPrincipalSecret = "";
2770-
activeConnectionProperties.remove(SQLServerDriverStringProperty.AAD_SECURE_PRINCIPAL_SECRET.toString());
27712769
return inetSocketAddress;
27722770
}
27732771

@@ -4458,6 +4456,9 @@ final void processFedAuthInfo(TDSReader tdsReader, TDSTokenHandler tdsTokenHandl
44584456
}
44594457

44604458
onFedAuthInfo(sqlFedAuthInfo, tdsTokenHandler);
4459+
4460+
aadPrincipalSecret = "";
4461+
activeConnectionProperties.remove(SQLServerDriverStringProperty.AAD_SECURE_PRINCIPAL_SECRET.toString());
44614462
}
44624463

44634464
final class FedAuthTokenCommand extends UninterruptableTDSCommand {

0 commit comments

Comments
 (0)