IsInRole methid is not working as expected

Discussion in 'ASP .Net Security' started by vineetbatta, Jan 6, 2007.

  1. vineetbatta

    vineetbatta Guest

    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
    vineetbatta, Jan 6, 2007
    #1
    1. Advertising

  2. vineetbatta

    vineetbatta Guest

    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
    vineetbatta, Jan 6, 2007
    #2
    1. Advertising

  3. Should work - you can use this page for troubleshooting:

    http://www.leastprivilege.com/content/binary/ShowContexts21.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.
    >
    Dominick Baier, Jan 6, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Bons
    Replies:
    1
    Views:
    483
    Patrick.O.Ige
    Mar 31, 2006
  2. =?Utf-8?B?dmluZWV0YmF0dGE=?=

    IsInRole does not work as expected

    =?Utf-8?B?dmluZWV0YmF0dGE=?=, Jan 6, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    356
    =?Utf-8?B?dmluZWV0YmF0dGE=?=
    Jan 6, 2007
  3. Replies:
    0
    Views:
    795
  4. Bob Erwin

    User.IsInRole not redirecting

    Bob Erwin, Nov 21, 2003, in forum: ASP .Net Security
    Replies:
    3
    Views:
    161
    Bob Erwin
    Dec 2, 2003
  5. Somyos

    Not use User.IsInRole in user control

    Somyos, Jun 1, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    100
    Somyos
    Jun 1, 2004
Loading...

Share This Page