Home > Software engineering >  How to validate remote server user name and password
How to validate remote server user name and password

Time:09-25

I want to write a program that is required when the system login user name and password authentication, the user name and password is on the remote server (probably AD server) have been built, I have to do is direct server remote user authentication, I look at the Microsoft MSDN, seems to be the Network Management Functions provides can realize, I saw the NetUserGetInfo shows that if the third parameter level=1, will get back the password, but the reality is directly return error, suggest there is no username or wrong password, but I saw the function, no password parameters, how to break? Or have any other way to solve this problem, many thanks!

CodePudding user response:

I always use LogonUser function, 0 x52e error, this is what causes,
The domain name test.com, aa, user password Jlxe! 1, the code is as follows:
 if (LogonUser (" aa ", "test.com", "Jlxe! 1, "LOGON32_LOGON_INTERACTIVE LOGON32_PROVIDER_DEFAULT, & amp; HUser)) 
{
MessageBox (" OK ");
}
The else
{
DwError=GetLastError ();
}

Finally, dwError=0 x52e
Ask what causes this?

CodePudding user response:

See if this has enlightenment ADSI interface to get the AD domain server account list/vc + +

CodePudding user response:

You use so there must be some problems, according to the MSDn, username must be a Unicode

The username
Pointer to a string containing the name of the user account on which the to return information

You use the Unicode compiled, string, meanwhile, combined with _T try (,,,,,,);
  • Related