Kerberos.NET
Kerberos.NET copied to clipboard
Setting RenewTickets does not respect existing cache file settings
Setting RenewTickets
seems to "forget" cache configuration of the client and revert back to default cache location. Code used:
var client = new KerberosClient(config, loggerFactory);
client.CacheInMemory = false;
client.Cache = new Krb5TicketCache(options.CacheFile);
client.RenewTickets = true;
after the last line runs, the cache is no longer pointing to what is specified in options.CacheFile
.
That's certainly odd. The client.RenewTickets
property just sets client.Cache.RenewTickets
which is not used at all in Krb5TicketCache
. I suspect that line is a red herring. I believe what's happening is KerberosClient.SetupCache()
is being called when client.Cache
is get
ed, which is querying the client-wide configuration for it's cache path.
https://github.com/dotnet/Kerberos.NET/blob/ddc0f270988b812dd6cd4dc71cfbbac5d938d21c/Kerberos.NET/Client/KerberosClient.cs#L686-L709
https://github.com/dotnet/Kerberos.NET/blob/ddc0f270988b812dd6cd4dc71cfbbac5d938d21c/Kerberos.NET/Client/KerberosClient.cs#L712-L726
I recently did an overhaul of how the client instantiates the cache. Can you see if this repros for you anymore?