IsInRole doesn't works correctly

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default IsInRole doesn't works correctly

    In my ASP.NET Application i check whether user that opens application is a
    member of my created Windows Group(Managers).

    if (Context.User.IsInRol(@"MyCompName\Managers"))
    {
    TextBox1.Text="OK";
    }

    If i use Integrated Windows Authentication in IIS all OK but with Basic
    Authentication i have a problem.
    What is a problem:
    When i first time open my application, the Basic Authentication Form is
    appear.
    I enter login and password of user that in my "Managers" local windows group
    and IsInRol works correctly.

    I close Internet Explorer. Remove this user from my "Managers" group and try
    again to open my application in hope
    to get IsInRol=False, but i get True.

    Only after restart IIS I get correctly result.

    Why it's works so and how can i resolve this problem because i need use
    Basic Authentication

    Thanks.


    alexb Guest

  2. Similar Questions and Discussions

    1. Progressbar works, loaded movie fails to run correctly.
      Hi, Maybe this is a noob problem but here it goes anyway: I'm using a loader movie (load.swf) to load my main moviefile.(main.swf) (with a...
    2. isInrole
      I am using isInRole function to check if a user is in a group. It works ok except it will suddenly stop working and I will have to reboot to get it...
    3. Problems with IsInRole
      I'm having problems with WindowsPrincipal.IsInRole. It's returning false when it should return true. I've written some test code that uses...
    4. isInRole doesn't work for one user, but works for everyone else
      I have an ASP.NET/C# application in which I verify that the current user is a member of a list of roles before giving them access to particular...
    5. Help with IsInRole
      Hi, I am using windows integrated authentication aon my intranet. How do I check if a user is a member of a group in active directory. I have the...
  3. #2

    Default Re: IsInRole doesn't works correctly

    Alex,

    There seems to be a problem (and possibly not one) with IsInRole
    functionality.Check this thread:
    [url]http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=O1wmwtE7CHA.2156%40TK2MSFTNGP12.phx.gbl& rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3DO1wmwtE7CHA.2156%2540TK2MSFTNGP12.phx.g bl%26rnum%3D1[/url]
    (or [url]http://tinyurl.com/2e2lm[/url]). I am not sure if I understand this correctly,
    but it seems to me that Basic Authentication is prone to caching problems.
    For example, if you call a Web Service programmatically passing valid basic
    credentials (which will establish a connection), the close the connection,
    and try the exactly same operation using wrong credentials, the operation
    will not fail (it will fail after a 30-minute - or so - timeout, though).
    See if Keith Brown's approach helps you (please post the solution if you
    find one).

    Alek

    "alexb" <alexb@ness-isi.com> wrote in message
    news:eqKbMipNEHA.3988@TK2MSFTNGP09.phx.gbl...
    > In my ASP.NET Application i check whether user that opens application is a
    > member of my created Windows Group(Managers).
    >
    > if (Context.User.IsInRol(@"MyCompName\Managers"))
    > {
    > TextBox1.Text="OK";
    > }
    >
    > If i use Integrated Windows Authentication in IIS all OK but with Basic
    > Authentication i have a problem.
    > What is a problem:
    > When i first time open my application, the Basic Authentication Form is
    > appear.
    > I enter login and password of user that in my "Managers" local windows
    group
    > and IsInRol works correctly.
    >
    > I close Internet Explorer. Remove this user from my "Managers" group and
    try
    > again to open my application in hope
    > to get IsInRol=False, but i get True.
    >
    > Only after restart IIS I get correctly result.
    >
    > Why it's works so and how can i resolve this problem because i need use
    > Basic Authentication
    >
    > Thanks.
    >
    >

    Alek Davis Guest

  4. #3

    Default Re: IsInRole doesn't works correctly

    You understand me correctly.

    If i remove user from windows group after first logon to my site, IsInRole
    works not correctly because Basic Authentication is prone to caching user
    token data.


    "Alek Davis" <alek_xDOTx_davis_xATx_intel_xDOTx_com> wrote in message
    news:eUf1umeOEHA.1340@TK2MSFTNGP12.phx.gbl...
    > Alex,
    >
    > There seems to be a problem (and possibly not one) with IsInRole
    > functionality.Check this thread:
    >
    [url]http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=O1wmwtE7CHA.2156%40TK2MSFTNGP12.phx.gbl& rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3DO1wmwtE7CHA.2156%2540TK2MSFTNGP12.phx.g bl%26rnum%3D1[/url]
    > (or [url]http://tinyurl.com/2e2lm[/url]). I am not sure if I understand this
    correctly,
    > but it seems to me that Basic Authentication is prone to caching problems.
    > For example, if you call a Web Service programmatically passing valid
    basic
    > credentials (which will establish a connection), the close the connection,
    > and try the exactly same operation using wrong credentials, the operation
    > will not fail (it will fail after a 30-minute - or so - timeout, though).
    > See if Keith Brown's approach helps you (please post the solution if you
    > find one).
    >
    > Alek
    >
    > "alexb" <alexb@ness-isi.com> wrote in message
    > news:eqKbMipNEHA.3988@TK2MSFTNGP09.phx.gbl...
    > > In my ASP.NET Application i check whether user that opens application is
    a
    > > member of my created Windows Group(Managers).
    > >
    > > if (Context.User.IsInRol(@"MyCompName\Managers"))
    > > {
    > > TextBox1.Text="OK";
    > > }
    > >
    > > If i use Integrated Windows Authentication in IIS all OK but with Basic
    > > Authentication i have a problem.
    > > What is a problem:
    > > When i first time open my application, the Basic Authentication Form is
    > > appear.
    > > I enter login and password of user that in my "Managers" local windows
    > group
    > > and IsInRol works correctly.
    > >
    > > I close Internet Explorer. Remove this user from my "Managers" group and
    > try
    > > again to open my application in hope
    > > to get IsInRol=False, but i get True.
    > >
    > > Only after restart IIS I get correctly result.
    > >
    > > Why it's works so and how can i resolve this problem because i need use
    > > Basic Authentication
    > >
    > > Thanks.
    > >
    > >
    >
    >

    alexb Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139