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. Web Development
  3. ASP.NET
  4. Basic Auth for ASP.NET

Basic Auth for ASP.NET

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdatabasesecurityquestion
4 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.
  • A Offline
    A Offline
    Adrian Hall
    wrote on last edited by
    #1

    I need to present one of those nice Authentication boxes to get a Username and Password and then 'do something' with the info - think of it as Windows authentication, but using my own authenticator instead of checking against the Windows database. Now, my thinking is that in the Page_Load() function, I can take a look to see if the Basic Auth token is there, and if it isn't, return the challenge. If it is there, I can test it and allow the username/password through to the page if its ok. Page_Load() may not be the best place for it - perhaps Session_Start()? Does anyone have code for this? -Adrian

    C 1 Reply Last reply
    0
    • A Adrian Hall

      I need to present one of those nice Authentication boxes to get a Username and Password and then 'do something' with the info - think of it as Windows authentication, but using my own authenticator instead of checking against the Windows database. Now, my thinking is that in the Page_Load() function, I can take a look to see if the Basic Auth token is there, and if it isn't, return the challenge. If it is there, I can test it and allow the username/password through to the page if its ok. Page_Load() may not be the best place for it - perhaps Session_Start()? Does anyone have code for this? -Adrian

      C Offline
      C Offline
      ChrisWFL
      wrote on last edited by
      #2

      Check out Forms based authentication. .Net will handle it for you. The "login" form can verify the username and password any way you care to handle it.

      A 1 Reply Last reply
      0
      • C ChrisWFL

        Check out Forms based authentication. .Net will handle it for you. The "login" form can verify the username and password any way you care to handle it.

        A Offline
        A Offline
        Adrian Hall
        wrote on last edited by
        #3

        Yes - I have that piece working - wanted to know if I could do Basic Auth though since I am replacing an app. that has Basic Auth already. -Adrian

        C 1 Reply Last reply
        0
        • A Adrian Hall

          Yes - I have that piece working - wanted to know if I could do Basic Auth though since I am replacing an app. that has Basic Auth already. -Adrian

          C Offline
          C Offline
          ChrisWFL
          wrote on last edited by
          #4

          Yes you can, but to use Basic Auth, it's much easier and better to just turn off anonymous users on that file or directory. IIS will then do it automatically.

          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