Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Using NTLM authentication for WindowsForms

Using NTLM authentication for WindowsForms

Scheduled Pinned Locked Moved C#
helpcsharpc++asp-netsysadmin
3 Posts 2 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Ragavendran Vaidhyanadhan
    wrote on last edited by
    #1

    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

    A 1 Reply Last reply
    0
    • R 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 Vaidhyanadhan

      A Offline
      A Offline
      Alex Korchemniy
      wrote on last edited by
      #2

      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.

      R 1 Reply Last reply
      0
      • A Alex Korchemniy

        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.

        R Offline
        R Offline
        Ragavendran Vaidhyanadhan
        wrote on last edited by
        #3

        Hi Thanx a bunch AK . I'll try doing that....:) Ragavendran Vaidhyanadhan

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups