null credentials even when tgt exists

Hi, I'm new to kerberos, jaas and gssapi and I need help. I'm on solaris 10. After kinit, klist shows the following:

bash-3.00# klist

Ticket cache: FILE:/tmp/krb5cc_0

Default principal: kerberos-test@RICHMOND.COM

Valid startingExpiresService principal

07/20/07 18:09:16 07/21/07 02:09:16 krbtgt/RICHMOND.COM@RICHMOND.COM

renew until 07/27/07 18:09:16

Then I use jaas and gssapi to get to a dir server, using the following config file:

GssExample {

com.sun.security.auth.module.Krb5LoginModule required

useTicketCache="true"

doNotPrompt="true"

refreshKrb5Config="true"

debug="true";

};

The intent is to use the tgt from the cache. But I get the following:

bash-3.00# java -Djava.security.auth.login.config=gsseg_jaas.conf -Djava.securi

ty.krb5.conf=/etc/krb5/krb5.conf GssExample auth "dc=ca,dc=com"

Debug is true storeKey false useTicketCache true useKeyTab false doNotPrompt tr

ue ticketCache is null KeyTab is null refreshKrb5Config is true principal is nul

l tryFirstPass is false useFirstPass is false storePass is false clearPass is fa

lse

Refreshing Kerberos configuration

Acquire TGT from Cache

Principal is null

null credentials from Ticket Cache

[Krb5LoginModule] authentication failed

Unable to obtain Princpal Name for authentication

Authentication attempt failedjavax.security.auth.login.LoginException: Unable to

obtain Princpal Name for authentication

Somehow, krb5loginmodule cannot get the tgt from the cache. I know my code works because if I remove the useTicketCache and doNotPrompt options, krb5loginmodule will ask for the username and password and everything works fine. But my requirement is to just use existing tickets.

Am I doing anything wrong somewhere? Thanks.

[1886 byte] By [cashroba] at [2007-11-27 11:16:32]
# 1

Ok, got it, it was due to encryption types. The kdc was encrypting with aes. When I modified krb5.conf to get only des3, it all worked. Strange that when it was failing, I was not getting any debug output that might point to the encryption type mismatch. But when it started working, it started showing debug output.

cashroba at 2007-7-29 14:19:41 > top of Java-index,Security,Kerberos & Java GSS (JGSS)...