views:

623

answers:

2

Are there examples which show how Delphi invokes the Active Directory Kerberos server to request a ticket granting ticket / normal ticket?

Background: the ticket is required for authentification to a web service which exchanges confidential information.

Edit: a short source code example would be very helpful. I have found the JEDI Windows Security Code Library which is very impressing. I am not sure if it contains support for Kerberos.

+2  A: 

According to this you should be able to get one with the InitializeSecurityContext windows API call.

Stijn Sanders
Thank you for the link - however to use it in Delphi it looks like many API record structures have to be created and filled first. I have started a bounty, maybe somebody can share some code.
mjustin
Most Win32 API headers have been converted under the JEDI project (http://jedi-apilib.sourceforge.net/), and if it's not there I usually use google's codesearch (http://www.google.com/codesearch?q=initializesecuritycontext+lang:pascal) to find hat I need.
Stijn Sanders
+1  A: 

First read Kerberizing Applications Using Security Support Provider Interface to get the general idea. InitializeSecurityContext is described as following:

Initiates a security context by generating a security token that must be passed to the server. The application that uses this function is called an SSPI client.

On msdn, the list of SSPI functions can be found in Authentication Functions.

For actual example code, see Win32 samples's SSPI page. You probably find client.cpp to be useful. Another similar example is GssClient.c. Both code are running it in a loop because the conversation keeps going if SEC_I_CONTINUE_NEEDED is returned.

eed3si9n