I am testing the JGSS sample on my local domain but have a problem with hostbased service. Below is the setup:
obtain a keytab generated from command
ktpass -princ myservice/[email protected] -mapuser [email protected] -crypto RC4-HMAC-NT -ptype KRB5_NT_PRINCILAL -pass krbpass -out myservice-host.keytab
system admin run
setspn -S myservice/host.my.example.com krbsrv
to set SPN for active directory.from GssClient.java create the serverprincipal by:
GSSName serverName = manager.createName(serverPrinc, GSSName.NT_HOSTBASED_SERVICE);
this will result in
java.security.PrivilegedActionException: GSSException: No valid credentials provided (Mechanism level: Server not found in Kerberos database (7))
exception.but if I call
createName()
withGSSName.NT_USER_NAME
there will be no error.I have asked system admin and verified no duplicate for
setspn -L krbsrv
andsetspln-X myservice/host.my.example.com
.
So would there be anything I have messed up? The server is running on Solaris and client is running on Windows, both on Java 6u27.
Advice is greatly appreciated.