Link to home
Start Free TrialLog in
Avatar of Niall Gallagher
Niall GallagherFlag for Ireland

asked on

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

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
ASKER CERTIFIED SOLUTION
Avatar of Coralon
Coralon
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Niall Gallagher

ASKER

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
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?

Coralon
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
I can't say for definite if these answers were right but they make the most sense to me.