IsInRole does not work as expected

Discussion in 'ASP .Net' started by =?Utf-8?B?dmluZWV0YmF0dGE=?=, Jan 6, 2007.

  1. 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
     
    =?Utf-8?B?dmluZWV0YmF0dGE=?=, Jan 6, 2007
    #1
    1. Advertising

  2. Even on restart of machine it return false. Any pointers?

    --
    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
    >
     
    =?Utf-8?B?dmluZWV0YmF0dGE=?=, Jan 6, 2007
    #2
    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. Brian Takita
    Replies:
    3
    Views:
    724
    Patrick Olurotimi Ige
    May 12, 2005
  2. Tenacious
    Replies:
    1
    Views:
    305
    Tenacious
    Dec 6, 2007
  3. vineetbatta

    IsInRole methid is not working as expected

    vineetbatta, Jan 6, 2007, in forum: ASP .Net Security
    Replies:
    2
    Views:
    146
    Dominick Baier
    Jan 6, 2007
  4. Salvador Sanjuan

    # sign does not work as expected form irb

    Salvador Sanjuan, Aug 26, 2009, in forum: Ruby
    Replies:
    14
    Views:
    201
    Salvador Sanjuan
    Aug 28, 2009
  5. Ishmael
    Replies:
    12
    Views:
    215
    Ishmael
    Jan 17, 2007
Loading...

Share This Page