作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有我的 asp.net web 服务器设置来使用 windows 身份验证。
它对我当前登录的用户进行身份验证就好了。
我可以通过查看来验证这一点...
HttpContext.Current.User.Identity.Name
HttpContext.Current.User.Identity.IsAuthenticated
HttpContext.Current.User.IsInRole("accounting")
最佳答案
好吧,似乎如果您引用的角色不存在,那么您会收到受信任的域错误。
当我从...更改时,错误消失了,代码运行良好。
HttpContext.Current.User.IsInRole("accounting")
HttpContext.Current.User.IsInRole("rsi_accounting")
关于asp.net - 使用windows认证,主域与受信域的信任关系失败,调用IsInRole时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2625509/
我是一名优秀的程序员,十分优秀!