我的IIS 7 web.config中的system.webServer / security / authorization无法正常工作(The system.webServer/security/

编程入门 行业动态 更新时间:2024-10-19 16:24:59
我的IIS 7 web.config中的system.webServer / security / authorization无法正常工作(The system.webServer/security/authorization in my IIS 7 web.config is not working)

在我的Admin文件夹的根目录中,我在web.config中有以下内容:

<system.webServer> <security> <authorization> <remove users="*" roles="" verbs="" /> <add accessType="Allow" users="" roles="Admin" /> </authorization> </security> </system.webServer>

这几乎是从IIS文档逐字逐句,但我将角色更改为“管理员”而不是“管理员”,因为这是我的应用程序中的角色。

我确保ASP.NET UrlAuthorization模块没有通过我的根web.config的modules元素中的<remove name="UrlAuthorization" />运行。 我刚刚安装了IIS7 UrlAuthorization,所以我知道它正在运行。

问题是即使我明确允许管理员角色并且已经验证我的管理员用户已登录,管理员也会收到未经授权的错误。 我有什么误会?

请注意,自从我开始编写这些问题以来,我解决了我明确枚举每个不允许的角色并删除remove users="*" ,但我不知道它为什么会起作用。

In the root of my Admin folder, I have the following in my web.config:

<system.webServer> <security> <authorization> <remove users="*" roles="" verbs="" /> <add accessType="Allow" users="" roles="Admin" /> </authorization> </security> </system.webServer>

This is almost verbatim from IIS documentation, but I changed the role to be "Admin" instead of "Administrators",because that's the role in my app.

I have ensured that the ASP.NET UrlAuthorization module is not running via a <remove name="UrlAuthorization" /> in the modules element of my root web.config. I just installed IIS7 UrlAuthorization, so I know it is running.

The problem is that even though I explicitly allow the Admin role and have validated my Admin user is logged in, the Admin gets an unauthorized error. What am I misunderstanding?

Note, since I started writing this questions, I resolved the issue my explicitly enumerating every disallowed role and removing the remove users="*", but I don't know why it worked.

最满意答案

看起来不会有这样的答案。 但是,如果其他人遇到同样的问题,我最终不得不改变我的方法并从ASP.NET管道外部管理安全性。

It doesn't look like there's going to be an answer to this. But in case anyone else runs across the same issue, I ended up having to change my approach and manage security externally from the ASP.NET pipeline.

更多推荐

Admin,UrlAuthorization,users,IIS,电脑培训,计算机培训,IT培训"/> <meta name=&q

本文发布于:2023-08-03 13:43:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1390642.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:无法正常   工作   config   system   IIS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!