WindowsPrincipal.IsInRole 不适用于 IIS 7/Win Server 2K8,但适用于 IIS 6/Win Server 2K3
当在 IIS 6/Win Server 2003 中运行的相同代码正常工作时,IIS 7/Win Server 2008 中是否存在某些设置或权限会导致 WindowsPrincipal.IsInRole 始终返回 false?以下是我调用该方法的方式:
IPrincipal principal = new WindowsPrincipal(WindowsIdentity.GetCurrent());
bool isInRole = principal.IsInRole("DOMAIN\Group"); // Always false in Win 2K8
Web 应用程序在两台服务器上都使用集成 Windows 身份验证运行。此外,Win 2008 服务器与 Win 2003 服务器位于不同的子域中。我正在检查的组与 Win 2003 服务器位于同一子域中。
如有必要,我可以提供更多详细信息,但我不确定哪些是相关的,哪些是噪音。
Is there some setting or permission in IIS 7/Win Server 2008 that would cause WindowsPrincipal.IsInRole
to always return false, when the same code running in IIS 6/Win Server 2003 works? Here's how I'm calling the method:
IPrincipal principal = new WindowsPrincipal(WindowsIdentity.GetCurrent());
bool isInRole = principal.IsInRole("DOMAIN\Group"); // Always false in Win 2K8
The web application is running with Integrated Windows Authentication on both servers. Also, the Win 2008 server is in a different sub-domain than the Win 2003 server. The groups that I'm checking against are in the same sub-domain as the Win 2003 server.
I can provide more details if necessary, but I'm not sure which ones are relevant and which would be noise.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查域控制器上的“DOMAIN\Group”是否是组的全名。它必须是组名称(Windows2000 之前的版本)。
Check on the Domain Controller if 'DOMAIN\Group' is the full name of the group. It must be the Group name (pre Windows2000).