The issue was just solved. Now default_realm will be respected and used.
commit cf6e39b6d4be9681dbf513a0c1417e5cf6ad839f
Author: Kai Zheng <[email protected]>
Date: Mon Nov 16 21:09:09 2015 +0800
Handling default config value in better way and solved DIRKRB-457
-----Original Message-----
From: Marc Boorshtein [mailto:[email protected]]
Sent: Saturday, November 14, 2015 11:57 PM
To: [email protected]
Subject: Re: Getting started with the client API
> Thanks Kai! We're making progress. Here's the current stack trace:
>
> Exception in thread "main" java.lang.NullPointerException
>
> at org.apache.kerby.kerberos.kerb.client.request.AsRequest.getTicket(
> AsRequest.java:135)
>
> at
> org.apache.kerby.kerberos.kerb.client.impl.DefaultInternalKrbClient.do
> RequestTgtTicket(
> DefaultInternalKrbClient.java:76)
>
> at
> org.apache.kerby.kerberos.kerb.client.impl.AbstractInternalKrbClient.r
> equestTgtTicket(
> AbstractInternalKrbClient.java:105)
>
> at
> org.apache.kerby.kerberos.kerb.client.KrbClient.requestTgtWithOptions(
> KrbClient.java:252)
>
> at
> org.apache.kerby.kerberos.kerb.client.KrbClient.requestTgtWithKeytab(
> KrbClient.java:194)
>
> at TestKerb.main(TestKerb.java:12)
>
> Looking at the kerberos messages over the wire it looks like its
> setting the realm to EXAMPLE.COM even though the krb5.conf file has
> "default_realm = RHELENT.LAN" which is causing the KDC to fail.
> Trying to see if I can make that setting in the code instead of the krb5.conf
> file.
>
> Thanks
>
>
> I got a ticket! Here's the code that worked:
KrbClient kerb = new KrbClient(new File("/Users/mlb/Documents/testkerb"));
kerb.init();
kerb.setKdcRealm("RHELENT.LAN");
TgtTicket tgt = kerb.requestTgtWithKeytab("HTTP/[email protected]",
new File("/Users/mlb/Documents/localdev.keytab"));
I'll open a jira ticket for the bug with the config so we can track it.
Thanks again! now for the fun part.