Commit d7fdd0a 1 parent be9bd4a commit d7fdd0a Copy full SHA for d7fdd0a
File tree 1 file changed +20
-0
lines changed
src/test/java/com/microsoft/sqlserver/jdbc
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,26 @@ private static void createKerberosConnection(String connectionString) throws Exc
92
92
}
93
93
}
94
94
95
+ /**
96
+ * Verify the Kerberos module used
97
+ */
98
+ @ Test
99
+ public void testKerberosConnectionWithDefaultJaasConfig () {
100
+ try {
101
+ String connectionString = connectionStringKerberos + ";useDefaultJaasConfig=true;" ;
102
+ createKerberosConnection (connectionString );
103
+
104
+ Configuration config = Configuration .getConfiguration ();
105
+ AppConfigurationEntry [] entries = config
106
+ .getAppConfigurationEntry (SQLServerDriverStringProperty .JAAS_CONFIG_NAME .getDefaultValue ());
107
+ Assertions .assertNotNull (entries );
108
+ Assertions .assertTrue (entries .length > 0 );
109
+ Assertions .assertEquals ("com.sun.security.auth.module.Krb5LoginModule" , entries [0 ].getLoginModuleName ());
110
+ } catch (Exception e ) {
111
+ Assertions .fail ("Exception was thrown: " + e .getMessage ());
112
+ }
113
+ }
114
+
95
115
/**
96
116
* Overwrites the default JAAS config. Call before making a connection.
97
117
*/
You can’t perform that action at this time.
0 commit comments