Hi

I'm using apache kerb-client for a java project with Kerberos
authentication. There is not enough documentation provided in neither of
the following pages. https://directory.apache.org/kerby/
https://github.com/apache/directory-kerby

I manage to successfully retrieve tgtTicket & then sgtTicket, but I don't
know how to retrieve the string form of the token value from sgtTicket?
Should it be from the sgtTicket.getSessionKey() or
sgtTicket.getTicket().getEncryptedEncPart() or any other way?

This is required since the other application which my application is hoping
to connect to, is expecting a string token.

Can someone please help?

            final var krbClient = getKrbClient();

            // TGT
            final var keyTabFile = new File(getKeytabPath());
            final var tgtTicket = krbClient.requestTgt(getPrincipal(),
keyTabFile);
            if (tgtTicket == null || tgtTicket.getSessionKey() == null) {
                aLog.error("Ticket Granting Ticket not found");

                throw new IllegalArgumentException("No Ticket Granting
Ticket retrieved");
            }

            // SGT
            final var sgtTicket = krbClient.requestSgt(tgtTicket,
getSpnHostName());
            if (sgtTicket == null || sgtTicket.getSessionKey() == null) {
                aLog.error("Service Granting Ticket not found");

                throw new IllegalArgumentException("No Service
Granting Ticket retrieved");
            }

            // retrieve string value of key from sgtTicket
            ????????

Best Regards

Nilanka

Reply via email to