Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > IsInRole methid is not working as expected

Reply
Thread Tools

IsInRole methid is not working as expected

 
 
vineetbatta
Guest
Posts: n/a
 
      01-06-2007
Hi,

I created a local group on server and added my self to that group.

I am using the following code in my web page to check the membership of the
loggedin user against the Windows group on the same server.

User.IsInRole(@'MachineName\groupName') . The above always return me false.
If i restart my machine then this returns true. Any clue why?

MachineName - is same as the server name on which the code is being run.

Windows Authentication is enabled and i checked the User.Identity and that
is coming correct and as expected. Subsequently i want to extend this to
check for some thing like DOMAIN\WINDOWSGROUP.

Thanks in advance.


--
MCAD
Vineet Batta
 
Reply With Quote
 
 
 
 
vineetbatta
Guest
Posts: n/a
 
      01-06-2007
Infact even on restart of the machine it still returns false.

--
MCAD
Vineet Batta


"vineetbatta" wrote:

> Hi,
>
> I created a local group on server and added my self to that group.
>
> I am using the following code in my web page to check the membership of the
> loggedin user against the Windows group on the same server.
>
> User.IsInRole(@'MachineName\groupName') . The above always return me false.
> If i restart my machine then this returns true. Any clue why?
>
> MachineName - is same as the server name on which the code is being run.
>
> Windows Authentication is enabled and i checked the User.Identity and that
> is coming correct and as expected. Subsequently i want to extend this to
> check for some thing like DOMAIN\WINDOWSGROUP.
>
> Thanks in advance.
>
>
> --
> MCAD
> Vineet Batta

 
Reply With Quote
 
 
 
 
Dominick Baier
Guest
Posts: n/a
 
      01-06-2007
Should work - you can use this page for troubleshooting:

http://www.leastprivilege.com/conten...Contexts21.zip
-----
Dominick Baier (http://www.leastprivilege.com)

> Hi,
>
> I created a local group on server and added my self to that group.
>
> I am using the following code in my web page to check the membership
> of the loggedin user against the Windows group on the same server.
>
> User.IsInRole(@'MachineName\groupName') . The above always return me
> false. If i restart my machine then this returns true. Any clue why?
>
> MachineName - is same as the server name on which the code is being
> run.
>
> Windows Authentication is enabled and i checked the User.Identity and
> that is coming correct and as expected. Subsequently i want to extend
> this to check for some thing like DOMAIN\WINDOWSGROUP.
>
> Thanks in advance.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: Page.User.IsInRole True for AD group in VS.NET not true on samemachine once published wildman@noclient.net ASP .Net 0 03-10-2008 08:54 PM
IsInRole does not work as expected =?Utf-8?B?dmluZWV0YmF0dGE=?= ASP .Net 1 01-06-2007 10:27 AM
User.IsInRole -> I do not want current user but all users Peter Bons ASP .Net 1 03-31-2006 09:31 AM
Not use User.IsInRole in user control Somyos ASP .Net Web Controls 0 06-01-2004 08:32 AM
User.IsInRole not redirecting Bob Erwin ASP .Net Security 3 12-02-2003 09:11 AM



Advertisments