Kent Boogaart
Kent Boogaart

Reputation: 178760

Relative path for JAAS keytab configuration

I have a system wherein .NET clients authenticate against a Java server with Kerberos. Everything works, but I'm trying to improve the server configuration. Currently a keytab file is required in the root of C:\ because my jaas.conf looks like this:

Server {
    com.sun.security.auth.module.Krb5LoginModule required
    useKeyTab=true
    storeKey=true
    isInitiator=false
    keyTab="///C:/keytab"
    principal="XXX";
};

I am trying to make the keyTab property a relative path, but am having no luck. What I've tried:

All of these result in an exception, so clearly the keytab file cannot be found.

I've searched and read the docs and banged my head on a wall over this. Can anyone reveal the magical incantation I need to make this happen?

Upvotes: 6

Views: 10524

Answers (2)

coderazzi
coderazzi

Reputation: 431

I tried as well putting the keytab in the same folder as the jaas.conf file (in the conf folder). Doing keytab="keytab" would not work. Fortunately, it uses the same configuration variables used elsewhere, so the solution was to set:

keyTab="${catalina.base}/conf/keytab"

Upvotes: 0

Michael
Michael

Reputation: 10329

Please use keyTab="keytab" Similar to the example: http://docs.oracle.com/javase/6/docs/technotes/guides/security/jgss/lab/part1.html

Upvotes: 1

Related Questions