This discussion is archived
1 Reply Latest reply: Jan 13, 2011 10:45 PM by AbidPir RSS

Problem with getting a service ticket - ignoring host name?

843810 Newbie
Currently Being Moderated
I've been struggling with this for several weeks on and off. The latest issue I have, is that when I try to obtain a service ticket it replaces the hostname I use with the ip address of the server. This then results in a 'Server not found in Kerberos database' exception.
    public static void main(String args[]) {
        try {
            org.ietf.jgss.Oid[] desiredMechs = new org.ietf.jgss.Oid[1];
            desiredMechs[0] = new org.ietf.jgss.Oid("1.2.840.113554.1.2.2");
            GSSManager manager = GSSManager.getInstance();
            GSSName clientName = manager.createName("MontgomeryB@LAB2K.NET", GSSName.NT_USER_NAME);
            GSSCredential clientCreds = manager.createCredential( GSSCredential.INITIATE_ONLY);
            GSSCredential clientCred = manager.createCredential(clientName,
            8 * 3600, desiredMechs[0], GSSCredential.INITIATE_ONLY);

           GSSName serverName = manager.createName("**", GSSName.NT_HOSTBASED_SERVICE);
Entered Krb5Context.initSecContext with state=STATE_NEW
Service ticket not found in the subject
Credentials acquireServiceCreds: same realm
Using builtin default etypes for default_tgs_enctypes default etypes for default_tgs_enctypes: 3 1 23 16 17.
KrbKdcReq send: UDP:88, timeout=30000, number of retries =3, #bytes=1276
KDCCommunication: UDP:88, timeout=30000,Attempt =1, #bytes=1276
KrbKdcReq send: #bytes read=92
KrbKdcReq send: #bytes read=92
KDCRep: init() encoding tag is 126 req type is 13
         sTime is Mon Jul 26 12:07:34 EDT 2010 1280160454000          suSec is 65057          error code is 7          error Message is Server not found in Kerberos database          realm is LAB2K.NET          sname is *HTTP/*          msgType is 30 KrbException: Server not found in Kerberos database (7)
Thanks - Bryan.