IsInRole still returns false!

M

Mong

Hi all,

Well I reckon I've just read through 200 messages on this subject and
tried every combination of every setting the is and I'm still getting
a return of false on IsInRole. Here's my code:

Dim rolUI_Admin as String
Dim wp As WindowsPrincipal

rolUI_Admin = "DOMAIN/DOM_ACL_TestAdmins"
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal)
wp = CType(Thread.CurrentPrincipal, WindowsPrincipal)

If wp.IsInRole(rolUI_Admin) Then
CheckUser = True
End If

I'm using Windows Authentication, Impersonation is off. Active
Directory set to 2000 native mode, Security bit in group is set.
wp.Identity returns correct user, Authenticated is true, and the user
is in the group. Web config contains <allow users="*" /> and <deny
users="?" /> - tried one or the other and both. Is there anything
else? I hope so cos I've done it all and still getting false.

The above code is in a VB module, does that make a difference? Can't
see why it would.

Ok so does anyone have any ideas on something else I can try?

Regards,

Mong
 
D

DalePres

All I had to do in my applications was to put in my web.config:
<identity impersonate="true" />

and then, in my codebehind, use

User.IsInRole("MyClientsDomain\GroupName")

and it works.



Dale Pres
 
M

Mong

Yep that's what about 200 other messages I read say but in this case
it does not work. Plus I don't want impersonation on!

Can't use User in a code module as far as I know, not that that should
make a difference.

I truly believe I can't do any more in the application as I've done
what appears to be exactly what everyone else has done, therefore I
believe the glitch is somewhere else like a network setting.

But thanks for your reply - any other takers?

How about someone from Microsoft afterall, it is your product?!
 
Joined
Jun 27, 2007
Messages
1
Reaction score
0
If you don't have impersonation on, the user will return as "ASPNET". Imperstonation means the process runs under the user account that was authenticated by IIS. So make sure IIS is configured to use Windows Authentication [DIRECTORY SECURITY > EDIT] on the properties of the Virtual directory and insert <identity impersonate="true" /> in the <System.Web> section of the Web.Config. Sorry for 2 year delay in reply :-D
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top