Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem with getting a service ticket - ignoring host name?

843810Jul 26 2010 — edited Jan 14 2011
Hello,
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("*HTTP@poe3b.lab2k.net*", 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.
CksumType: sun.security.krb5.internal.crypto.RsaMd5CksumType
EType: sun.security.krb5.internal.crypto.ArcFourHmacEType
KrbKdcReq send: kdc=labad2.lab2k.net UDP:88, timeout=30000, number of retries =3, #bytes=1276
KDCCommunication: kdc=labad2.lab2k.net 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
KRBError:
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/172.16.118.89* msgType is 30 KrbException: Server not found in Kerberos database (7)
Thanks - Bryan.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 11 2011
Added on Jul 26 2010
1 comment
3,378 views