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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Windows Authentication

Windows Authentication

Scheduled Pinned Locked Moved C#
questioncomsecuritytools
2 Posts 2 Posters 0 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.
  • P Offline
    P Offline
    Programm3r
    wrote on last edited by
    #1

    Hi all, I'm trying to create a login that should use Windows Authentication. This is what I have done so far: protected void Login1_Authenticate(object sender, AuthenticateEventArgs e) { if (Login1.UserName == "admin" && Login1.Password == "admin") e.Authenticated = true; }
    So how can I authenticate the username and password with the windows logon?? Many Thanks Regards,


    The only programmers that are better that C programmers are those who code in 1's and 0's :bob: :)Programm3r My Blog: ^_^

    J 1 Reply Last reply
    0
    • P Programm3r

      Hi all, I'm trying to create a login that should use Windows Authentication. This is what I have done so far: protected void Login1_Authenticate(object sender, AuthenticateEventArgs e) { if (Login1.UserName == "admin" && Login1.Password == "admin") e.Authenticated = true; }
      So how can I authenticate the username and password with the windows logon?? Many Thanks Regards,


      The only programmers that are better that C programmers are those who code in 1's and 0's :bob: :)Programm3r My Blog: ^_^

      J Offline
      J Offline
      jkersch
      wrote on last edited by
      #2

      just use win32 api to impersonate with your user credentials. try something like [DllImport("advapi32.dll", CharSet=CharSet.Auto)] public static extern int LogonUser(String lpszUserName, String lpszDomain, String lpszPassword, int dwLogonType, int dwLogonProvider, ref IntPtr phToken); regards j.

      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