Using Kerberos as authentication mechanism to connect to the Studio can be done by using one of the following authentication types:
Note that for Kerberos the fully qualified domain name must be used, unlike NTLM. For example, considering user user in the domain hr.example.com, the user name is HR.EXAMPLE.COM\user. HR\user won't work. |
The recommended configuration for Windows setups is using the Local Service Authority to retrieve the credentials for the Kerberos default authentication.
The following steps have to be performed to have a working Kerberos client:
Create a file in a secure location (%AQUIMA_HOME%\krb5login.conf for example) with the following contents:
com.sun.security.jgss.initiate { com.sun.security.auth.module.Krb5LoginModule required client=true doNotPrompt=true useTicketCache=true; }; com.sun.security.jgss.login { com.sun.security.auth.module.Krb5LoginModule required client=true; }; |
The com.sun.security.jgss.initiate context is used for the default Kerberos authentication and instructs the authentication and authorization service (JAAS) to use the LSA for retrieving the current credentials.
The com.sun.security.jgss.login context is used for the custom Kerberos authentication.
This file describes the domains that are available and the translation between domains and realms.
Create a file in a secure location (%AQUIMA_HOME%\krb5.conf for example) with the following contents:
[realms] <for each domain with users that should be able to log in> <fqdn in uppercase> = { kdc = <domain controller fqdn> } <end for each> [domain_realm] <for each domain with users that should be able to log in> .<fqdn> = <fqdn in uppercase> <fqdn> = <fqdn in uppercase> <end for each> |
Assuming there are 2 domains that should allow login (hr.example.com and financial.example.com), the file should look like:
[realms] HR.EXAMPLE.COM = { kdc = dc.hr.example.com } FINANCIAL.EXAMPLE.COM = { kdc = domain_controller.financial.example.com } [domain_realm] .hr.example.com = HR.EXAMPLE.COM hr.example.com = HR.EXAMPLE.COM .financial.example.com = FINANCIAL.EXAMPLE.COM financial.example.com = FINANCIAL.EXAMPLE.COM |
See http://web.mit.edu/kerberos/krb5-1.12/doc/admin/conf_files/krb5_conf.html for more details on the configuration file format. |
The following java options can be set:
Option | Description |
---|---|
java.security.krb5.conf | Path to the Kerberos configuration file |
java.security.auth.login.config | Path to the JAAS login configuration file |
javax.security.auth.useSubjectCredsOnly | Determines if credentials can be obtained from external sources. See Oracle docs. |
Assuming the location of the configuration files as suggested above, the following configuration options would have to be set:
-Djava.security.krb5.conf=%AQUIMA_HOME%\krb5.conf -Djava.security.auth.login.config=%AQUIMA_HOME%\krb5login.conf -Djavax.security.auth.useSubjectCredsOnly=false |
Setting java runtime options differs for each application server and is out the scope of this article. For tomcat 7 for example, a setenv.bat file has to be created in %CATALINA_HOME%\bin with contents like:
|
Option | Description |
---|---|
java.security.debug | Enables JAAS debug logging. See Oracle docs. |
sun.security.krb5.debug | Enables Kerberos debug logging. |
A typical example would be setting the following java options:
-Djava.security.krb5.conf=%AQUIMA_HOME%\krb5.conf -Djava.security.auth.login.config=%AQUIMA_HOME%\krb5login.conf -Djava.security.debug=configfile,configfileparser,logincontext -Dsun.security.krb5.debug=true -Djavax.security.auth.useSubjectCredsOnly=false |
Due to US export laws, the JDK and JRE are shipped with limited cryptography extensions. More importantly, AES256 is not supported by default. If the AD uses AES256 encryption (since Windows Server 2008), then the unlimited Java Cryptography Extension (JCE) Policy must be downloaded and installed. The Unlimited JCE Policy consists of two jar files which must be placed in %JAVA_HOME%/jre/lib/security. The installed JCE must match the JDK/JRE version. The following table provides quick links to these policies:
In order for the Java Runtime to be able to use the credentials from the LSA, a Windows Registry setting needs to be enabled in order to allow the session key from the TGT to be read. Under HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Lsa/Kerberos/Parameters
, add the following entry:
Normally, the Runtime should not be running as a Local Administrator user, but in development or testing it may happen that, for reasons outside control, the Runtime will run as such a user. In this case, the registry setting should be enabled and when finished it should be turned off again, as it is a potential security risk. See https://support.microsoft.com/en-us/kb/2627903 for details.
Kerberos is very sensitive to DNS configuration because it uses it by default to canonicalize host names. So you have to make sure DNS and reverse DNS entries are available for the machine running the runtime, the machine running the studio and the domain controllers of the domains.
See the defaults for the dns_canonicalize_hostname and rdns settings in the Kerberos configuration file reference. |
Assuming we have the following:
We should check the following DNS records exist and are accessible on m2:
If we plan to login with domain2 users as well, we should also check for:
You can use nslookup to check for DNS records:
|
For HTTP services, the default service identity assumed by browsers is the SPN "HTTP/hostname". For example, if the URL for StudioService is "http://studio-pc:8093/Services/StudioService", then browsers assume the identity of this service is the SPN "HTTP/studio-pc".
The SPN is in essence an alias for a domain account (user account or computer account). In order to create this alias, the setspn.exe
command must be used:
# if studio is running as a system account on machine studio-pc setspn -A HTTP/studio-pc studio-pc # if studio is running as a domain user account, on machine studio-pc setspn -A HTTP/studio-pc user One domain account can have multiple SPN aliases. For example, if you access the StudioService using different URLs, then for each URL a SPN can be created: # if you connect using the URL http: //studio-pc:8093/Services/StudioService (using only the NetBIOS name) setspn -A HTTP/studio-pc studio-pc # if you connect using the URL http: //studio-pc.example.com:8093/Services/StudioService (using the fully-qualified domain name) setspn -A HTTP/studio-pc.example.com studio-pc |
For development mode there is an easier option:
The recommended configuration for Linux setups is:
Add an entry for the user that should be used to log in:
addent -password -p <user>@<fqdn in uppercase> -k 1 -e rc4-hmac |
Write the keytab file
wkt <keytab file name> |
Exit kutil:
quit |
Check the contents of the keytab file:
klist -k -t <path to keytab file> |
Move the keytab file to a secure location ($AQUIMA_HOME\keytab in our example)
Do not forget to set the owner the user running the application server.
For some practical information about kutil and keytabs, see https://kb.iu.edu/d/aumh. |
Create a file in a secure location ($AQUIMA_HOME\krb5login.conf for example) with the following contents:
com.sun.security.jgss.initiate { com.sun.security.auth.module.Krb5LoginModule required doNotPrompt=true principal="<user>@<fqdn in uppercase>" useKeyTab=true keyTab="<path to keytab file>" storeKey=true; }; com.sun.security.jgss.login { com.sun.security.auth.module.Krb5LoginModule required client=true; }; |
The com.sun.security.jgss.initiate context is used for the default Kerberos authentication and instructs the authentication and authorization service (JAAS) to use the keytab file for retrieving the login credentials.
The com.sun.security.jgss.login context is used for the custom Kerberos authentication.
This is identical to the Windows procedure.
This is identical to setting the properties in Windows.
A tomcat setenv.sh might look like:
export AQUIMA_HOME=<path to aquima home> export JAVA_OPTS="-Djava.security.krb5.conf=$AQUIMA_HOME\krb5.conf -Djava.security.auth.login.config=$AQUIMA_HOME\krb5login.conf -Djava.security.debug=configfile,configfileparser,logincontext -Dsun.security.krb5.debug=true -Djavax.security.auth.useSubjectCredsOnly=false" |
This is identical to the Windows procedure.
This is identical to the Windows procedure.
This is identical to the Windows procedure.
This is identical to the Windows procedure.