Server not found in Kerberos database (7)

Hi,

I am trying to run the GSSClient/GSSServer example in the JAAS/JGSS tutorial.

In the tutorial it says "So for the purposes of trying out this tutorial, you could use your user name as both the client user name and the service principal name. "

As I dont have permissions to make modifications to Active Directory, I thought I could use this to get away from having to create a SPN. So I am using my username for both the client user and the SPN.

When the GSSClient tries to establish a context with the server, it fails because it cant find the server in the kerberos database. But I am using my user name ffor server principal and simple JAAS authentication succeeds with my username so why cant GSSClient find it

when trying to establish a context ?

Any clues would be greatly appreciated.

Thanks !

Here is the stack trace ..

KrbException: Identifier doesn't match expected value (906)

at sun.security.krb5.internal.af.a(DashoA6275:134)

at sun.security.krb5.internal.ae.a(DashoA6275:63)

at sun.security.krb5.internal.ae.<init>(DashoA6275:58)

at sun.security.krb5.KrbTgsRep.<init>(DashoA6275:49)

at sun.security.krb5.KrbTgsReq.getReply(DashoA6275:222)

at sun.security.krb5.internal.az.a(DashoA6275:299)

at sun.security.krb5.internal.az.a(DashoA6275:111)

at sun.security.krb5.Credentials.acquireServiceCreds(DashoA6275:495)

at sun.security.jgss.krb5.Krb5Context.initSecContext(Krb5Context.java:580)

at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:213)

at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:158)

at GssClient$GssClientAction.run(GssClient.java:170)

at java.security.AccessController.doPrivileged(Native Method)

at javax.security.auth.Subject.doAs(Subject.java:379)

at Jaas.loginAndAction(Jaas.java:94)

at GssClient.main(GssClient.java:97)

KrbException: Server not found in Kerberos database (7)

at sun.security.krb5.KrbTgsRep.<init>(DashoA6275:64)

at sun.security.krb5.KrbTgsReq.getReply(DashoA6275:222)

at sun.security.krb5.internal.az.a(DashoA6275:299)

at sun.security.krb5.internal.az.a(DashoA6275:111)

at sun.security.krb5.Credentials.acquireServiceCreds(DashoA6275:495)

at sun.security.jgss.krb5.Krb5Context.initSecContext(Krb5Context.java:580)

at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:213)

at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:158)

at GssClient$GssClientAction.run(GssClient.java:170)

at java.security.AccessController.doPrivileged(Native Method)

at javax.security.auth.Subject.doAs(Subject.java:379)

at Jaas.loginAndAction(Jaas.java:94)

at GssClient.main(GssClient.java:97)

Caused by: KrbException: Identifier doesn't match expected value (906)

at sun.security.krb5.internal.af.a(DashoA6275:134)

at sun.security.krb5.internal.ae.a(DashoA6275:63)

at sun.security.krb5.internal.ae.<init>(DashoA6275:58)

at sun.security.krb5.KrbTgsRep.<init>(DashoA6275:49)

... 12 more

java.security.PrivilegedActionException: GSSException: No valid credentials provided (Mechanism level: Server not found in Kerberos database (7))

at java.security.AccessController.doPrivileged(Native Method)

at javax.security.auth.Subject.doAs(Subject.java:379)

at Jaas.loginAndAction(Jaas.java:94)

at GssClient.main(GssClient.java:97)

Caused by: GSSException: No valid credentials provided (Mechanism level: Server not found in Kerberos database (7))

at sun.security.jgss.krb5.Krb5Context.initSecContext(Krb5Context.java:665)

at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:213)

at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:158)

at GssClient$GssClientAction.run(GssClient.java:170)

... 4 more

[4014 byte] By [SecurityTyroa] at [2007-11-26 15:33:42]
# 1
In order to use user principal on the both side, you need to make sure the contents of client and server entries should look similar in the JAAS config file.You can always add -Dsun.security.krb5.debug=true to the java command line to see what more debug info.
wangwja at 2007-7-8 21:50:52 > top of Java-index,Security,Kerberos & Java GSS (JGSS)...