I have a .Net client WPF application using System.DirectoryServices and LDAP for authentication. On start of the app, I want to force users to re-authenticate using their domain account (which is how they logged into windows). I understand I can use the following to perform the authentication when a connection is available.
DirectoryEntry entry = new DirectoryEntry("LDAP://" + domain,
userName, password);
The wrinkle is that the application is at times used by remote users who may not have a connection. Windows itself still allows domain users to sign on even when disconnected. Is there a similar means of authenticating users in a disconnected environment using the .Net Framework?
Believe I found a way to do this using the LogonUser function of advapi32.dll.
When disconnected this appears to validate against the local cached version of the last log on.