Using NTLM authentication for WindowsForms
-
Let me describe the requirements.. There is a Windows 2000 server machine... and i want to perform windows integrated authentication. Will I be able to receive a username , password , logon domain name from a user and be able to authenticate the user under the workgroup server. ASP.NET provides authentication using and the authentication type can be specified as "WINDOWS". But , can the same be done using WindowsForms. C++ provides LogonUser() Method which takes the username , domainame and password , the authentication type ,the authentication level and a "token" , which i used as an assmebly.
public static extern bool LogonUser(String lpszUsername, String lpszDomain, String lpszPassword,int dwLogonType, int dwLogonProvider, out int phToken);
Can a user Windowsidentity be created just from the username and password ? When i tried using logonuser() i get errors because the usertoken is not known and i cannot be zero.bool loggedOn = LogonUser( // User name. textBox1.Text.ToString(), // Computer name. ".", // Password. textBox2.Text.ToString(), // Logon type = LOGON32_LOGON_NETWORK_CLEARTEXT. 3, // Logon provider = LOGON32_PROVIDER_DEFAULT. 0, // The user token for the specified user is returned here. out token1);
A workgroup server can have a lot of servers in the domain and each server machine can have numerous users inside the each server. Is there a suitable way to solve this issue ? If the problem definition is not clear ,I can restate the problem .. thanx in advance.:) Ragavendran Vaidhyanadhan -
Let me describe the requirements.. There is a Windows 2000 server machine... and i want to perform windows integrated authentication. Will I be able to receive a username , password , logon domain name from a user and be able to authenticate the user under the workgroup server. ASP.NET provides authentication using and the authentication type can be specified as "WINDOWS". But , can the same be done using WindowsForms. C++ provides LogonUser() Method which takes the username , domainame and password , the authentication type ,the authentication level and a "token" , which i used as an assmebly.
public static extern bool LogonUser(String lpszUsername, String lpszDomain, String lpszPassword,int dwLogonType, int dwLogonProvider, out int phToken);
Can a user Windowsidentity be created just from the username and password ? When i tried using logonuser() i get errors because the usertoken is not known and i cannot be zero.bool loggedOn = LogonUser( // User name. textBox1.Text.ToString(), // Computer name. ".", // Password. textBox2.Text.ToString(), // Logon type = LOGON32_LOGON_NETWORK_CLEARTEXT. 3, // Logon provider = LOGON32_PROVIDER_DEFAULT. 0, // The user token for the specified user is returned here. out token1);
A workgroup server can have a lot of servers in the domain and each server machine can have numerous users inside the each server. Is there a suitable way to solve this issue ? If the problem definition is not clear ,I can restate the problem .. thanx in advance.:) Ragavendran VaidhyanadhanI would love to help you with your problem, but to my disappointment I can't. In fact not many people know about this kind of stuff, because they never thought about using it. Here's something you can try : Go to http://msdn.microsoft.com/newsgroups[^] The microsoft newsgroups - have more professionals that work in very narrow feilds (ie. NTLM authentication). So far I always had good luck, and got my questions answered.
-
I would love to help you with your problem, but to my disappointment I can't. In fact not many people know about this kind of stuff, because they never thought about using it. Here's something you can try : Go to http://msdn.microsoft.com/newsgroups[^] The microsoft newsgroups - have more professionals that work in very narrow feilds (ie. NTLM authentication). So far I always had good luck, and got my questions answered.
Hi Thanx a bunch AK . I'll try doing that....:) Ragavendran Vaidhyanadhan