An SPN (Service Principal Name) links your SQL Server service to your chosen account.
Run the following commands on the Domain Controller using a Command Prompt as Administrator.
setspn -L YOURDOMAIN\AccountNamesetspn -A MSSQLSvc/yourhost.domain.com:1433 YOURDOMAIN\AccountNameyourhost.domain.com with the actual SQL Server FQDNAccountName with the account running the SQL Server serviceA Keytab file allows Applications Manager to authenticate automatically with SQL Server.
Log in to the Domain Controller using a Domain Administrator account.
Choose one of the options below based on your SQL Server configuration.
Use this if SQL Server runs under a dedicated service account (e.g., sql_service).
ktpass -out C:\ms_sql.keytab ^
-mapuser YOUR_SERVICE_ACCOUNT@YOURDOMAIN.COM ^
-princ MSSQLSvc/SQL_SERVER_FQDN:1433@YOURDOMAIN.COM ^
-pass ACCOUNT_PASSWORD ^
-ptype KRB5_NT_PRINCIPAL ^
-crypto AES256-SHA1 ^
-mapOp setUse this if SQL Server runs under the default Administrator account.
ktpass -out C:\ms_sql.keytab ^
-mapuser Administrator@YOURDOMAIN.COM ^
-princ MSSQLSvc/SQL_SERVER_FQDN:1433@YOURDOMAIN.COM ^
-pass ADMIN_PASSWORD ^
-ptype KRB5_NT_PRINCIPAL ^
-crypto AES256-SHA1 ^
-mapOp setYOURDOMAIN.COM with the actual domain name in UPPERCASESQL_SERVER_FQDN with the full hostname of the SQL ServerACCOUNT_PASSWORD with the Active Directory password of the accountExample:
sql01.yourdomain.comThe command above creates the file: C:\ms_sql.keytab
<APM_HOME>\working\conf\KerberosConfigurations\MSSQL\Run this on the server where Applications Manager is installed.
cd <APM_HOME>\working\jre\bin\kinit.exe -k -t ..\..\conf\KerberosConfigurations\MSSQL\ms_sql.keytab YOUR_PRINCIPAL_NAME@YOURDOMAIN.COMUse the same principal name specified after -princ during ktpass.
| Result | Meaning |
|---|---|
| No error | Verification successful |
Preauthentication failed |
Incorrect password used while generating keytab |
If authentication fails:
Navigate to:
<APM_HOME>\working\conf\KerberosConfigurations\MSSQL\MicrosoftJDBCDriver\Open the file using Notepad or any text editor. Choose one of the following configurations.
SQLJDBCDriver {
com.sun.security.auth.module.Krb5LoginModule required
useKeyTab=true
keyTab="/working/conf/KerberosConfigurations/MSSQL/ms_sql.keytab"
principal="YOUR_PRINCIPAL_NAME@YOURDOMAIN.COM"
doNotPrompt=true
storeKey=false
useTicketCache=false
debug=false;
};Run the following command on the Applications Manager server:
kinit -c <APM_HOME>\working\conf\KerberosConfigurations\MSSQL\krb5cc_user YourUser@YOURDOMAIN.COMEnter the domain password when prompted.
SQLJDBCDriver {
com.sun.security.auth.module.Krb5LoginModule required
useTicketCache=true
ticketCache="/working/conf/KerberosConfigurations/MSSQL/krb5cc_user"
principal="YourUser@YOURDOMAIN.COM"
doNotPrompt=true
useKeyTab=false
debug=false;
};Use forward slashes (/) in file paths.
Correct:
C:/AppManager/working/conf/The domain name must be uppercase.
Correct:
@YOURDOMAIN.COMOpen:
<APM_HOME>\working\jre\lib\security\java.securityFind:
#login.config.url.1=file:${user.home}/.java.login.configAdd the following line below it:
login.config.url.1=file:/working/conf/KerberosConfigurations/MSSQL/MicrosoftJDBCDriver/login.confNavigate to:
<APM_HOME>\working\conf\KerberosConfigurations\Create a file named:
apmKrb5.confK in Krb5 must be uppercase.Use this when Applications Manager and SQL Server belong to the same domain.
[libdefaults]
default_realm = YOURDOMAIN.COM
dns_lookup_realm = false
dns_lookup_kdc = true
ticket_lifetime = 24h
forwardable = yes
udp_preference_limit = 1
[realms]
YOURDOMAIN.COM = {
kdc = dc-hostname.yourdomain.com
admin_server = dc-hostname.yourdomain.com
default_domain = yourdomain.com
}
[domain_realm]
.yourdomain.com = YOURDOMAIN.COM
yourdomain.com = YOURDOMAIN.COMUse this when Applications Manager and SQL Server belong to different trusted domains.
[libdefaults]
default_realm = APM-DOMAIN.COM
dns_lookup_realm = false
dns_lookup_kdc = true
ticket_lifetime = 24h
forwardable = yes
udp_preference_limit = 1
[realms]
SQL-DOMAIN.COM = {
kdc = sql-dc.sql-domain.com
admin_server = sql-dc.sql-domain.com
}
APM-DOMAIN.COM = {
kdc = apm-dc.apm-domain.com
admin_server = apm-dc.apm-domain.com
}
[domain_realm]
.sql-domain.com = SQL-DOMAIN.COM
.apm-domain.com = APM-DOMAIN.COM
[capaths]
APM-DOMAIN.COM = {
SQL-DOMAIN.COM = .
}
SQL-DOMAIN.COM = {
APM-DOMAIN.COM = .
}cd <APM_HOME>
shutdownApplicationsManager.bat
shutdownApplicationsManager.bat -forcecd <APM_HOME>
sh shutdownApplicationsManager.sh
sh shutdownApplicationsManager.sh -forceNavigate to:
<APM_HOME>\working\conf\Rename: database_params.conf
To: database_params.conf.bak
Copy:
<APM_HOME>\working\conf\MSSQL\KerberosAuth\MicrosoftJDBC\database_params.confPaste into:
<APM_HOME>\working\conf\Edit the new database_params.conf and update:
| Parameter | Description |
|---|---|
SQL_SERVER_FQDN |
SQL Server FQDN |
PORT |
SQL Server port |
DATABASE NAME |
Database name |
Start Applications Manager.
Once the web console is accessible, log in to Applications Manager and navigate to:
Settings → Tools → Support → Database Summary
Now execute the following SQL query:
SELECT
b.session_id,
b.login_name,
a.auth_scheme,
b.host_name,
program_name
FROM sys.dm_exec_connections AS a
JOIN sys.dm_exec_sessions AS b
ON a.session_id = b.session_id
ORDER BY program_name, host_name;You can also use the following script located under: APPMANAGER_HOME/bin/troubleshooting/
MSSQLDebug.batto verify Kerberos connectivity.
If Applications Manager fails to start or connect:
database_params.confdatabase_params.conf.bak back to database_params.confThis restores standard password-based authentication.