First and foremost,
1) I am a newbie to the whole active directory thing, so I may be
completely off the mark
2) I could not find a suitable forum for my post, (aspnet security was
closest, however the replies that I would get would be very ASP
oriented and my requirement is winforms)
I have a client server application. At present the user name and
passwords are held in a separate data store and the application does
the authentication itself. I would like to go to ActiveDirectory for
the authentication. The way I want to do it is, As soon as my
application is launched, I want to find out if the current windows
user has been authenticated against the active directory.
If there is a local machine user (who does not have the active
directory), he will not be able to use my application irrespective of
successfully logging into windows. I do not know how to go about it.
I used the following code
System.Security.Principal.WindowsIdentity wi =
System.Security.Principal.WindowsIdentity.GetCurrent();
if (wi.IsAuthenticated)
{
MessageBox.Show("Welcome dude !!");
}
else
{
MessageBox.Show("Bye bye!!");
}
and even in case of a local user, the IsAuthenticated returns true, so
I am not sure how to fulfill my requirement.
TIA,
--SP
|