[Last Call] Learn how to a build a cloud-first strategyRegister Now


User.IsInRole, Roles.IsUserInRole not showing me as member of group

Posted on 2014-08-22
Medium Priority
Last Modified: 2014-09-25
Hi, I am trying to build a website for our domain and trusted domain at the start I got our Network guys to put the users into an AD group which was universal security group and put it into authorization in Web.config and this worked perfectly in Development and everybody could hit it until I put it into production (the production web server is in a DMZ) then the website would open for nobody except me. So I changed the code so it did not challenge you when entering site <all users="*"> but when you tried to do anything it challenged you there with
 if (Roles.IsUserInRole(User.Identity.Name, @"Domain\Secure Group")

Open in new window

but it does not recognise me as in the group (This is back in the development server) but if I check AD it shows I am a member. I tried changing the group to other groups to double check it is working and if I put in any other group it comes back true.
I am totally at a loss and not sure what direction to go now. Any help would be greatly appreciated
Question by:Niall292
  • 3
  • 2
LVL 25

Accepted Solution

Coralon earned 1000 total points
ID: 40280098
It sounds like your DMZ is not allowing traffic back to the DC's in the domain. (This is generally not surprising.. most firewall & systems admin don't like to allow that at all).  You'll need to configure that backend authentication path from your server back to a DC through the firewall.  

If you can get that enabled, then your site should work.


Author Comment

ID: 40280245
That seems to make sense for when it was in production and I will ask our network guys to try it on Monday but also do you have any idea why IsInRole is not working in development and only on that one group
LVL 25

Expert Comment

ID: 40282357
My guess (purely a guess) would be that somehow it recognized that your account had the permissions before it was put in the DMZ, unless you have local admin rights?

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

LVL 20

Assisted Solution

compdigit44 earned 1000 total points
ID: 40283512
A little of topic but using ADFS instead on open your firewall to your internal DC's would be more secure

Author Comment

ID: 40343632
Just an update, eventually some of the network guys asked me was I still having problems and to try it now and suddenly it was working.
According to them they did nothing and I know I didn't do anything so I am not sure how it got fixed but it did.

Author Closing Comment

ID: 40343635
I can't say for definite if these answers were right but they make the most sense to me.

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Compliance and data security require steps be taken to prevent unauthorized users from copying data.  Here's one method to prevent data theft via USB drives (and writable optical media).
Active Directory can easily get cluttered with unused service, user and computer accounts. In this article, I will show you the way I like to implement ADCleanup..
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question