Windows Authentication
-
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....
-
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....
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!
-
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!
Thank you.
oooo, the Jedi's will feel this one....