-
July 26th, 2005, 10:48 AM
#1
How to confirm if user password is correct
Hi,
I have following problem: I have domain and few users.
Now in my software I want to create log screen where user enters his/hers domain name and password. How can i confirm if entered password is user's domain password?
I've tried LogonUser but it will not work since not all users have required privileges. I'm looking for something very simple, for example function that will try to access something or log somewhere with user name and password and simply return true or false.
I've tried WNetAddConnection2 but NO_ERROR is returned only if "user" is currently logged user, what's weird works with any password. Doesn't work for any other user.
Code:
NETRESOURCE resource;
ZeroMemory(&resource,sizeof(NETRESOURCE));
resource.dwType = RESOURCETYPE_ANY;
resource.lpRemoteName = "\\\\Omega\\netShare";
resource.lpLocalName = "";
DWORD result = WNetAddConnection2(&resource, "pass", "user", CONNECT_UPDATE_PROFILE);
I've found this link: http://www.codeguru.com/forum/showthread.php?t=245025& with userverify.zip example but this is pretty complicated and I will use it if there's nothing else that works. Any ideas what else can I try?
Last edited by lechoo; July 27th, 2005 at 02:07 PM.
-
July 27th, 2005, 11:55 AM
#2
Re: How to confirm if user password is correct
This example might be confusing and complicated but it is very good and you should work through it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|