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. Windows Authentication

Windows Authentication

Scheduled Pinned Locked Moved ASP.NET
securityhelpcsharpasp-netsysadmin
3 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
    Paul Unsworth
    wrote on last edited by
    #1

    Hi Guys I'm a bit of a newb to the joys of ASP.NET, and I have a bit of a problem... I'm trying to use windows authentication with my app as it's intended for intranet. I have the following in my main web.config:

    <authentication mode="Windows"/>
    <authorization>
    <allow users="*"/>
    <deny users="?"/>
    </authorization>

    And I have the following in the config file of a directory that I only want certain users to see:

    <configuration>
    <appSettings/>
    <connectionStrings/>
    <system.web>
    <authorization>
    <allow users="unswortp"/>
    <allow users="HO\unswortp"/>
    </authorization>
    </system.web>
    </configuration>

    My problem is the restrictions on the folder will not allow me to get into that folder when deployed to the IIS server, although it works fine on my development machine. I cant help but think that the Windows Credentials it is using are not on the local machine, but on the server, so once deployed to the server, I have no chance. Am I doing something wrong? or is this just the way the windows authentication works in ASP.NET Apps? Is there something else I need to set up? Also, how would I pluck the Windows Username of the end user programatically?

    oooo, the Jedi's will feel this one....

    D 1 Reply Last reply
    0
    • P Paul Unsworth

      Hi Guys I'm a bit of a newb to the joys of ASP.NET, and I have a bit of a problem... I'm trying to use windows authentication with my app as it's intended for intranet. I have the following in my main web.config:

      <authentication mode="Windows"/>
      <authorization>
      <allow users="*"/>
      <deny users="?"/>
      </authorization>

      And I have the following in the config file of a directory that I only want certain users to see:

      <configuration>
      <appSettings/>
      <connectionStrings/>
      <system.web>
      <authorization>
      <allow users="unswortp"/>
      <allow users="HO\unswortp"/>
      </authorization>
      </system.web>
      </configuration>

      My problem is the restrictions on the folder will not allow me to get into that folder when deployed to the IIS server, although it works fine on my development machine. I cant help but think that the Windows Credentials it is using are not on the local machine, but on the server, so once deployed to the server, I have no chance. Am I doing something wrong? or is this just the way the windows authentication works in ASP.NET Apps? Is there something else I need to set up? Also, how would I pluck the Windows Username of the end user programatically?

      oooo, the Jedi's will feel this one....

      D Offline
      D Offline
      Dinesh Mani
      wrote on last edited by
      #2

      Check your Directory Security tab in the website property in IIS. May be IIS is configured to allow anonymous access while your application is denying access to anonymous users. Check the below links for details on how to use Windows authentication with ASP.NET and how it works. How To: Use Windows Authentication in ASP.NET 2.0[^] Recipe: Enabling Windows Authentication within an Intranet ASP.NET Web application [^] This is 4m Scott Guthrie's blog. Explained: Windows Authentication in ASP.NET 2.0[^] HTH!

      P 1 Reply Last reply
      0
      • D Dinesh Mani

        Check your Directory Security tab in the website property in IIS. May be IIS is configured to allow anonymous access while your application is denying access to anonymous users. Check the below links for details on how to use Windows authentication with ASP.NET and how it works. How To: Use Windows Authentication in ASP.NET 2.0[^] Recipe: Enabling Windows Authentication within an Intranet ASP.NET Web application [^] This is 4m Scott Guthrie's blog. Explained: Windows Authentication in ASP.NET 2.0[^] HTH!

        P Offline
        P Offline
        Paul Unsworth
        wrote on last edited by
        #3

        Thank you.

        oooo, the Jedi's will feel this one....

        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