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. Advertisements

  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. Advertisements

  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. Advertisements

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. Richard Huff
    Replies:
    2
    Views:
    534
    Richard Huff
    Jan 6, 2004
  2. Natty Gur
    Replies:
    1
    Views:
    2,022
    Marshal Antony
    Mar 3, 2004
  3. =?Utf-8?B?amFtbWVy?=

    Validation not working as expected

    =?Utf-8?B?amFtbWVy?=, Aug 19, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    488
    =?Utf-8?B?amFtbWVy?=
    Aug 19, 2005
  4. Steve Franks

    Cache not working as expected

    Steve Franks, Sep 11, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    582
    Jeremy S.
    Sep 11, 2005
  5. SteveSu
    Replies:
    2
    Views:
    17,923
    SteveSu
    Nov 8, 2005
  6. J055
    Replies:
    1
    Views:
    3,308
    Steven Cheng[MSFT]
    Mar 13, 2006
  7. radvieira
    Replies:
    1
    Views:
    2,765
    Thomas Hawtin
    Aug 30, 2005
  8. =?Utf-8?B?dmluZWV0YmF0dGE=?=

    IsInRole does not work as expected

    =?Utf-8?B?dmluZWV0YmF0dGE=?=, Jan 6, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    441
    =?Utf-8?B?dmluZWV0YmF0dGE=?=
    Jan 6, 2007
Loading...