Paw*_*iya 5 windows-authentication asp.net-mvc-4
我正在尝试对我的应用程序使用Windows身份验证,对于我尝试过的测试只允许我自己并拒绝所有其余的
<authentication mode="Windows" />
<authorization>
<allow users="DomainName\nogariyap" />
<deny users="*"/>
</authorization>
Run Code Online (Sandbox Code Playgroud)
但Access Denied即使我使用相同的用户登录到我的机器,它也会给我" "错误"DomainName\nogariyap"
当我把它改成这个
<allow users="*" />
Run Code Online (Sandbox Code Playgroud)
有用
我不知道为什么它不适用于特定的Windows用户?
编辑
当我添加它时它扼杀了 system.webServer
<security>
<authentication>
<windowsAuthentication enabled="true" />
<anonymousAuthentication enabled="false" />
</authentication>
<authorization>
<remove users="*" roles="" verbs="" />
<add users="DomainName\nogariyap" accessType="Allow"/>
<add users="?" accessType="Deny"/>
</authorization>
</security>
Run Code Online (Sandbox Code Playgroud)
但我不知道它为什么不使用这些设置system.web,这两个设置有什么区别?
<system.web>是项目配置,<system.webserver>是服务器配置。两者应该兼容,但建议似乎是使用服务器配置而不是另一个。它是在 IIS7 上引入的。两者之间的一些区别是:
| 归档时间: |
|
| 查看次数: |
2312 次 |
| 最近记录: |