You can find a sample mule 4 application attached with this article to connect Kerberos enabled Microsoft SQL Serve using Database connector. Below are the different steps to be followed to configure the app.
<dependency> <groupId>com.microsoft.sqlserver</groupId> <artifactId>mssql-jdbc</artifactId> <version>6.4.0.jre8</version> </dependency>
<sharedLibrary> <groupId>com.microsoft.sqlserver</groupId> <artifactId>mssql-jdbc</artifactId> </sharedLibrary>
<db:config name="Database_Config" doc:name="Database Config" doc:id="63c99ba2-67df-4d79-aa89-ee796bf9769a"> <db:generic-connection url="jdbc:sqlserver://<hostname>;databaseName=<DB Name>;integratedSecurity=true;authenticationScheme=JavaKerberos;" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" /> </db:config>
SQLJDBCDriver {
com.sun.security.auth.module.Krb5LoginModule required
useKeyTab=true
keyTab="/opt/mule/mule-CURRENT/apps/<application name>/mulesoftcommon.keytab"
useTicketCache=false
doNotPrompt=true
principal="mulesoft_common_dev@MULESOFT.COM";
};
While using the Anypoint studio on your Windows machine, make sure that you use the below format in "keyTab". The path must contain "\\".SQLJDBCDriver {
com.sun.security.auth.module.Krb5LoginModule required
useKeyTab=true
keyTab="C:\\<folder-path-to-keytab-file>\\mulesoftcommon.keytab"
useTicketCache=false
doNotPrompt=true
principal="mulesoft_common_dev@MULESOFT.COM";
};
where,
keyTab points to the absolute path of the keytab file which is generated from Kerberos credentials
principal in the format user@domain
java.security.auth.login.config=/opt/mule/apps/<application name>/SQLJDBCDriver.conf java.security.krb5.kdc=KDC01.mulesoft.com java.security.krb5.realm=MULESOFT.COM
java.security.auth.login.config=C:\<path-to-your-studio-project>\src\main\resources\config\SQLJDBCDriver-local.conf
/opt/mule/mule-CURRENT/apps/<application name>/mulesoftcommon.keytab /opt/mule/mule-CURRENT/apps/<application name>/SQLJDBCDriver.conf
/opt/mule/apps/<application name>/mulesoftcommon.keytab /opt/mule/apps/<application name>/SQLJDBCDriver.conf
C:\\<folder-path-to-keytab-file>\\mulesoftcommon.keytab C:\<path-to-your-studio-project>\src\main\resources\config\SQLJDBCDriver-local.conf
001116985

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.