HttpContext.Current.User.IsInRole() Authorization issue
I am facing a strange issue while authorizing myself via HttpContext.Current.User.IsI开发者_运维技巧nRole("DOMAIN\\RoleName")
.
There is an AD Group A which has another group B as a member. I am a member of A and B both. However when I try to authorize myself for A and B it gives me false and true respectively. That is for A it does not authorizes me while for B it does. Is it that even if I am member of parent group and child group, the IsInRole will authorize only for child group.
No, that's not it - if you're looking for GroupA, and are a member of it, GroupB is irrelevant.
Could it be you misspelled it? Are they both in the same domain?
Otherwise verify that GroupA is a security group, otherwise it wont appear in your roles.
I think my issue is resolved by one of the below ways:
- I reset my IIS.
- I deleted my cookies on the machine.
Miraculously, it worked. Thanks for your responses AviD.
I did have a similar issue and after hours of debugging I solved it by logging off and logging with at the client after changing groups in the active directory.
I didn't have to restart the iis server or deleting all cookies.
精彩评论