-
January 12th, 2001, 02:19 PM
#1
How to verify NT username and password?
I have a username and password sent to me from a remote NT machine. How do I check that they're valid for logging on to NT?
Thanks a bunch!
Alvaro
-
January 12th, 2001, 02:47 PM
#2
Re: How to verify NT username and password?
You have two options:
1. Use LogonUser function (easy way). The calling process must have the
SE_TCB_NAME privilege.
2. Use NTLM SSP to validate credentials (hard way). The SE_TCB_NAME
privilege is not required.
http://support.microsoft.com/support.../Q180/5/48.ASP
-
January 12th, 2001, 03:07 PM
#3
Thanks!
This is exactly what I needed. Thank you very much!
Alvaro
-
July 2nd, 2001, 02:04 PM
#4
Re: How to verify NT username and password?
How to let The calling process have the
SE_TCB_NAME privilege?
First know what you don't know, then you will know what you will know
-
July 2nd, 2001, 02:09 PM
#5
Re: How to verify NT username and password?
The correct way is to make a service, which will run in the system logon
session and therefore will have SE_TCB_PRIVILEGE.
For testing purposes, you can grant this privilege to a specific user
account with User Manager in NT 4 or with Local Security Policy applet
in Window 2000. The privilege is named "Act as part of operating system"
in the GUI.
-
July 2nd, 2001, 02:24 PM
#6
Re: How to verify NT username and password?
Now I longon Win2000 Srever as "adminstrator",and run the follow code.
I have set "User1" The privilege -- "Act as part of operating system" in the GUI as you told.
But can not run correctly.
The return value is ERROR_PRIVILEGE_NOT_HELD.
if (LogonUser("User1", ".", "User1",
LOGON32_LOGON_INTERACTIVE , LOGON32_PROVIDER_DEFAULT, &hToken) == FALSE){
dwRet = GetLastError();
if(dwRet == ERROR_LOGON_FAILURE)
cout << "ERROR_LOGON_FAILURE";
if(dwRet == ERROR_LOGON_TYPE_NOT_GRANTED)
cout << "ERROR_LOGON_TYPE_NOT_GRANTED";
if(dwRet == ERROR_PRIVILEGE_NOT_HELD)
cout << "ERROR_PRIVILEGE_NOT_HELD";
}
First know what you don't know, then you will know what you will know
-
July 2nd, 2001, 02:35 PM
#7
Re: How to verify NT username and password?
The calling user must have the TCB privilege, not the user which you are
trying to log in. In your case, the administrator must have this privilege,
not User1.
-
May 31st, 2002, 06:18 AM
#8
Programatically pass "UserName", "PassWd" and "DomainName" for proxy
Hi,
The Proxy that i am using is strictly configured such that the internet clients (eg IE, Netscape or some customized internet clients) needs to authenticate by giving a
1. User Name
2. Pass Word
3. Domain Name
(If i am using IE and trying to open a url, immidiatly IE prompts a dialog for "User Name", "Pass Word" and "Domain Name" that are used for authentication from the serverside. These credentials are normally my emailid/password/email-domain-name)
I am trying to write a program that uses the following APIs for accessing the internet and download a page..
//START
HINTERNET goInetHnd;
HINTERNET aoURL;
//OPEN CONNECTION
goInetHnd = ::InternetOpen (
STD_BROWSER_SIG,
INTERNET_OPEN_TYPE_PRECONFIG,
NULL, NULL, 0
);
//SPECIFY AUTHENTICATION USERNAME
strcpy (azUser,"user-name");
aiUsrLen=strlen (azUser);
InternetSetOption (goInetHnd, INTERNET_OPTION_USERNAME, azUser, (unsigned long)aiUsrLen);
//SPECIFY AUTHENTICATION PASSWORD
strcpy (azPass, "pass-word");
aiPasLen=strlen (azPass);
InternetSetOption (goInetHnd, INTERNET_OPTION_PASSWORD, azPass, (unsigned long)aiPasLen);
//OPEN URL
aoURL = ::InternetOpenUrl (
goInetHnd,
azUrl,
NULL, 0, 0, 0
);
//GET PAGE DATA
InternetReadFile (aoURL, azTemp, aiReadLen, &aiLen); // placed in loop
//CLOSE URL
InternetCloseHandle (aoURL);
//END
Here i donno how to specify the "domain name" authentication. There is no option in InternetSetOption API like INTERNET_OPTION_DOMAINNAME. I also tried by passing the domain-name along with user-name as
//SPECIFY AUTHENTICATION USERNAME
strcpy (azDomAndUser,"domain-name\\user-name"); // strcpy (azDomAndUser,"\\domain-name\\user-name");
aiDomUsrLen=strlen (azDomAndUser);
InternetSetOption (goInetHnd, INTERNET_OPTION_USERNAME, azDomAndUser, (unsigned long)aiDomUsrLen);
And this is also not working..
I am in extreme need to obtain a good optimum solution for this.. if possible by using WinInet API. Please let me know your suggestion.
Regards
R.Padmakumar
-
May 31st, 2002, 05:20 PM
#9
For proxy authentication you should use INTERNET_OPTION_PROXY_PASSWORD and INTERNET_OPTION_PROXY_USERNAME options. However, I have no idea where to put the domain name.
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
|