Does anyone know how to clear out the Kerberos ticket cache on the local computer - using managed \ unmanaegd code?
Thanks in advance!
To destroy your tickets, use the kdestroy command. % /usr/bin/kdestroy. The kdestroy command destroys all your tickets.
The file is located in the c:\windows\temp directory by default. WARNING: This script is simply a wrapper for the included OS tool Klist.exe. The script simply loops through each known SessionID and attempts to dump the Kerberos cache from that session.
purge - Allows you to delete a specific ticket. Purging tickets destroys all tickets that you have cached, so use this attribute with caution. It might stop you from being able to authenticate to resources. If this happens, you'll have to log off and log on again.
I believe you need to do a call to LsaCallAuthenticationPackage using KERB_PURGE_TKT_CACHE_REQUEST after using either LsaConnectUntrusted or LsaRegisterLogonProcess. Sorry no specifics, but I don't have my code for this around...
The most simple way is to take the source code of Microsoft's KList (Included in the platform SDK\ Samples), and to do like them...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With