Asp.net IIS 7.5和授权
我有一个asp.net/silverlight网站,以前在iis6下工作。我们正在升级到iis7.5,但我无法让它正常工作 基本上以前,网站是通过表单授权建立的,整个网站设置为拒绝所有用户。然后,我设置登录页面、图像和default.aspx文件以供异常访问。一切都好 我还对其他文件夹进行了角色安全设置。一旦用户登录,他们将获得他们的角色,并且能够访问他们被授予访问权限的文件夹 在7.5中,几乎没有任何东西起作用。我跟踪了网上的所有信息,但没有结果。有人能帮忙吗 以下是我的web.config文件的部分Asp.net IIS 7.5和授权,asp.net,forms-authentication,iis-7.5,Asp.net,Forms Authentication,Iis 7.5,我有一个asp.net/silverlight网站,以前在iis6下工作。我们正在升级到iis7.5,但我无法让它正常工作 基本上以前,网站是通过表单授权建立的,整个网站设置为拒绝所有用户。然后,我设置登录页面、图像和default.aspx文件以供异常访问。一切都好 我还对其他文件夹进行了角色安全设置。一旦用户登录,他们将获得他们的角色,并且能够访问他们被授予访问权限的文件夹 在7.5中,几乎没有任何东西起作用。我跟踪了网上的所有信息,但没有结果。有人能帮忙吗 以下是我的web.config文
<authentication mode="Forms">
<forms loginUrl="login.aspx" requireSSL="false" timeout="30" />
</authentication>
<authorization>
<deny users="?" />
</authorization>
<location path="images">
<system.webServer>
<security>
<authorization>
<add accessType="Allow" users="*" />
</authorization>
</security>
</system.webServer>
</location>
<location path="default.aspx">
<system.webServer>
<security>
<authorization>
<add accessType="Allow" users="*" />
</authorization>
</security>
</system.webServer>
</location>
<location path="www">
<system.webServer>
<security>
<authorization>
<add accessType="Allow" users="*" />
</authorization>
</security>
</system.webServer>
</location>
<location path="manuals/customer">
<system.webServer>
<security>
<authorization>
<add accessType="Allow" users="" roles="man_customer" />
<add accessType="Deny" users="*" />
</authorization>
</security>
</system.webServer>
</location>
<location path="manuals/msa">
<system.webServer>
<security>
<authorization>
<add accessType="Allow" users="" roles="man_msa" />
<add accessType="Deny" users="*" />
</authorization>
</security>
</system.webServer>
</location>
<location path="documents/msa">
<system.webServer>
<security>
<authorization>
<add accessType="Allow" users="" roles="doc_msa" />
<add accessType="Deny" users="*" />
</authorization>
</security>
</system.webServer>
</location>
<location path="documents/admin">
<system.webServer>
<security>
<authorization>
<add accessType="Allow" users="" roles="doc_admin" />
<add accessType="Deny" users="*" />
</authorization>
</security>
</system.webServer>
</location>
<location path="documents/customer">
<system.webServer>
<security>
<authorization>
<add accessType="Allow" users="" roles="doc_customer" />
<add accessType="Deny" users="*" />
</authorization>
</security>
</system.webServer>
</location>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules>
<remove name="FormsAuthentication" />
<add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" />
<remove name="UrlAuthorization" />
<add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule" />
<remove name="DefaultAuthentication" />
<add name="DefaultAuthentication" type="System.Web.Security.DefaultAuthenticationModule" />
<remove name="RoleManager" />
<add name="RoleManager" type="System.Web.Security.RoleManagerModule" />
<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated" />
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</handlers>
<security>
<authorization>
<remove users="*" roles="" verbs="" />
<add accessType="Allow" users="?" />
</authorization>
</security>
<defaultDocument>
<files>
<clear />
<add value="default.aspx" />
</files>
</defaultDocument>
</system.webServer>
当网站启动时,它最初会重定向到login.aspx文件。无法访问images文件夹中的图像。不确定它在IIS 6上是如何工作的,但我在IIS 7.5上运行了类似的功能,我的
web.config
看起来有些不同。试试这个:
<system.web>
<authentication mode="Forms">
<forms loginUrl="login.aspx" requireSSL="false" timeout="30" />
</authentication>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
<location path="images">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
不确定您是如何让它在IIS 6上运行的,但我在IIS 7.5上运行了类似的东西,我的
web.config
看起来有点不同。试试这个:
<system.web>
<authentication mode="Forms">
<forms loginUrl="login.aspx" requireSSL="false" timeout="30" />
</authentication>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
<location path="images">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
非常奇怪。我添加了上述内容,并再次发挥作用,但角色不起作用。我将角色更改回iis 7.5版本,它们开始正常工作。非常非常奇怪非常奇怪。我添加了上述内容,并再次发挥作用,但角色不起作用。我将角色更改回iis 7.5版本,它们开始正常工作。非常非常奇怪