From 9af77eb452da13bc8ac96baade304a10389bf43c Mon Sep 17 00:00:00 2001 From: Muskan Gupta Date: Thu, 23 Jan 2025 09:47:36 +0530 Subject: [PATCH 1/3] Testing login module changes --- .../microsoft/sqlserver/jdbc/KerbAuthentication.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/KerbAuthentication.java b/src/main/java/com/microsoft/sqlserver/jdbc/KerbAuthentication.java index d02238196..8fdcd10b6 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/KerbAuthentication.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/KerbAuthentication.java @@ -42,11 +42,11 @@ final class KerbAuthentication extends SSPIAuthentication { private boolean useDefaultNativeGSSCredential = false; private GSSContext peerContext = null; - static { - // Overrides the default JAAS configuration loader. - // This one will forward to the default one in all cases but the default configuration is empty. - Configuration.setConfiguration(new JaasConfiguration(Configuration.getConfiguration())); - } + // static { + // // Overrides the default JAAS configuration loader. + // // This one will forward to the default one in all cases but the default configuration is empty. + // Configuration.setConfiguration(new JaasConfiguration(Configuration.getConfiguration())); + // } /** * Initializes the Kerberos client security context From a2e605f9959f94b6986068fdeb1b5a40332b17dc Mon Sep 17 00:00:00 2001 From: Muskan Gupta Date: Thu, 23 Jan 2025 11:06:14 +0530 Subject: [PATCH 2/3] Testing login module changes (null) --- .../microsoft/sqlserver/jdbc/KerbAuthentication.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/KerbAuthentication.java b/src/main/java/com/microsoft/sqlserver/jdbc/KerbAuthentication.java index 8fdcd10b6..2d59c100b 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/KerbAuthentication.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/KerbAuthentication.java @@ -42,11 +42,12 @@ final class KerbAuthentication extends SSPIAuthentication { private boolean useDefaultNativeGSSCredential = false; private GSSContext peerContext = null; - // static { - // // Overrides the default JAAS configuration loader. - // // This one will forward to the default one in all cases but the default configuration is empty. - // Configuration.setConfiguration(new JaasConfiguration(Configuration.getConfiguration())); - // } + static { + // Set the JAAS configuration programmatically if not already set + if (null == Configuration.getConfiguration().getAppConfigurationEntry("SQLJDBCDriver")) { + Configuration.setConfiguration(new JaasConfiguration(Configuration.getConfiguration())); + } + } /** * Initializes the Kerberos client security context From 5b37c660e3b86bfb53bcb202de312306846f1d53 Mon Sep 17 00:00:00 2001 From: Muskan Gupta Date: Wed, 29 Jan 2025 12:44:49 +0530 Subject: [PATCH 3/3] Updated setting configuration in test setup --- .../com/microsoft/sqlserver/jdbc/KerbAuthentication.java | 7 ------- .../java/com/microsoft/sqlserver/jdbc/KerberosTest.java | 1 + 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/KerbAuthentication.java b/src/main/java/com/microsoft/sqlserver/jdbc/KerbAuthentication.java index 2d59c100b..120f78999 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/KerbAuthentication.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/KerbAuthentication.java @@ -42,13 +42,6 @@ final class KerbAuthentication extends SSPIAuthentication { private boolean useDefaultNativeGSSCredential = false; private GSSContext peerContext = null; - static { - // Set the JAAS configuration programmatically if not already set - if (null == Configuration.getConfiguration().getAppConfigurationEntry("SQLJDBCDriver")) { - Configuration.setConfiguration(new JaasConfiguration(Configuration.getConfiguration())); - } - } - /** * Initializes the Kerberos client security context * diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/KerberosTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/KerberosTest.java index 47f0a9252..738705424 100644 --- a/src/test/java/com/microsoft/sqlserver/jdbc/KerberosTest.java +++ b/src/test/java/com/microsoft/sqlserver/jdbc/KerberosTest.java @@ -26,6 +26,7 @@ public class KerberosTest extends AbstractTest { @BeforeAll public static void setupTests() throws Exception { + Configuration.setConfiguration(new JaasConfiguration(Configuration.getConfiguration())); setConnection(); }