How to change keytab file location in Jasig CAS under Tomcat under Windows Server

I am using a CAS server on a Windows 2008R2 machine. Everything works fine, but only when I put my keytab file in C :. Currently my login.conf is as follows:

jcifs.spnego.initiate { com.sun.security.auth.module.Krb5LoginModule required storeKey=true useKeyTab=true keyTab="file:///C:\spn-account.keytab"; }; jcifs.spnego.accept { com.sun.security.auth.module.Krb5LoginModule required storeKey=true useKeyTab=true keyTab="file:///C:\spn-account.keytab"; 

I would like to change the location of the keytab file in my Tomcat directory. I tried the following (including moving the keytab itelft file) and both of them do not work:

 jcifs.spnego.initiate { com.sun.security.auth.module.Krb5LoginModule required storeKey=true useKeyTab=true keyTab="file:///C:\Program%20Files\spn-account.keytab"; }; jcifs.spnego.accept { com.sun.security.auth.module.Krb5LoginModule required storeKey=true useKeyTab=true keyTab="file:///C:\Program%20Files\Tomcat\spn-account.keytab"; 

and

 jcifs.spnego.initiate { com.sun.security.auth.module.Krb5LoginModule required storeKey=true useKeyTab=true keyTab="file:///C:\Progra~1\Tomcat\spn-account.keytab"; }; jcifs.spnego.accept { com.sun.security.auth.module.Krb5LoginModule required storeKey=true useKeyTab=true keyTab="file:///C:\Progra~1\Tomcat\spn-account.keytab"; 

Does anyone know how I can change the location of the keytab file in my Tomcat directory?

+6
source share
1 answer

Try using java style for keyTab. Use slashes instead of backslashes; if you need to use a backslash, they must be double escaped (four backslashes anytime you want) so that they can be read into properties and then create URIs from them.

+1
source

Source: https://habr.com/ru/post/957187/


All Articles