WindowsPrincipal.IsInRole() is Being Flaky. Help!!

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

  1. #1

    Default WindowsPrincipal.IsInRole() is Being Flaky. Help!!

    Its just being inconsistent.

    I'm in 3 different Groups in AD.

    ..IsInRole("Groupx") returns true
    ..IsInRole("Groupy") returns true
    ..IsInRole("Groupz") returns FALSE

    All of these groups reside in the same location in my AD tree, but for some
    reason, the one is returning False.

    even stranger, if I do a search for "Groupz" and list out its members
    (through DirectoryServices) my account information shows up.

    I have no idea why my account is in the group, but that lookup doesn't work
    for the group, but it dows for others.

    Ideas??
    Anyone??
    I'm not proud, I'll beg, I'll make cheesecake!
    David Jessee Guest

  2. Similar Questions and Discussions

    1. isinrole reverts to windowsprincipal?
      I'm trying to assign all roles (AD and custom pulled from SQL Table) to users when they login to the app using Windows Authentication. The code...
    2. WindowsPrincipal.IsInRole() problem with non-builtin roles
      Can't get WindowsPrincipal.IsInRole() to work for me when using Windows Authentication. Here's a snippit of code from my C# codebehind page: ...
    3. CurrentPrincipal, WindowsPrincipal
      Hello Friend Please check following Cod Dim x As System.Security.Principal.WindowsPrincipa x = System.Threading.Thread.CurrentPrincipa...
    4. #9876 [Com]: OCIPLogon flaky after restart Oracle
      ID: 9876 Comment by: aferaud at buyingpack dot com Reported By: merrill at missioncriticallinux dot com Status: ...
    5. Combo box flaky update
      On Sat, 28 Jun 2003 11:24:00 +0100, Alex L. James <alex@walton23.freeserve.co.uk> wrote: Please post your code. John W. Vinson Come for...
  3. #2

    Default Re: WindowsPrincipal.IsInRole() is Being Flaky. Help!!

    Is the group security enabled? What type of group is it (groupType)?

    Joe K.

    "David Jessee" <DavidJessee@discussions.microsoft.com> wrote in message
    news:9CE609AB-6DCC-4F44-9F34-B2B5E9604529@microsoft.com...
    > Its just being inconsistent.
    >
    > I'm in 3 different Groups in AD.
    >
    > .IsInRole("Groupx") returns true
    > .IsInRole("Groupy") returns true
    > .IsInRole("Groupz") returns FALSE
    >
    > All of these groups reside in the same location in my AD tree, but for
    > some
    > reason, the one is returning False.
    >
    > even stranger, if I do a search for "Groupz" and list out its members
    > (through DirectoryServices) my account information shows up.
    >
    > I have no idea why my account is in the group, but that lookup doesn't
    > work
    > for the group, but it dows for others.
    >
    > Ideas??
    > Anyone??
    > I'm not proud, I'll beg, I'll make cheesecake!

    Joe Kaplan \(MVP - ADSI\) Guest

  4. #3

    Default Re: WindowsPrincipal.IsInRole() is Being Flaky. Help!!

    The Scope is Global, the Group Type is Security.

    Okay, folks, I'm gonna up the antie. Anyone want Fudge? Home made!!

    "Joe Kaplan (MVP - ADSI)" wrote:
    > Is the group security enabled? What type of group is it (groupType)?
    >
    > Joe K.
    >
    > "David Jessee" <DavidJessee@discussions.microsoft.com> wrote in message
    > news:9CE609AB-6DCC-4F44-9F34-B2B5E9604529@microsoft.com...
    > > Its just being inconsistent.
    > >
    > > I'm in 3 different Groups in AD.
    > >
    > > .IsInRole("Groupx") returns true
    > > .IsInRole("Groupy") returns true
    > > .IsInRole("Groupz") returns FALSE
    > >
    > > All of these groups reside in the same location in my AD tree, but for
    > > some
    > > reason, the one is returning False.
    > >
    > > even stranger, if I do a search for "Groupz" and list out its members
    > > (through DirectoryServices) my account information shows up.
    > >
    > > I have no idea why my account is in the group, but that lookup doesn't
    > > work
    > > for the group, but it dows for others.
    > >
    > > Ideas??
    > > Anyone??
    > > I'm not proud, I'll beg, I'll make cheesecake!
    >
    >
    >
    David Jessee Guest

  5. #4

    Default Re: WindowsPrincipal.IsInRole() is Being Flaky. Help!!

    Ok, that group should definitely be in the user's token then. Assuming you
    definitely have the name correct, the next thing I'd do is a little
    exploration on the user's token.

    I'd try this reflection code to see what's actually in the user's token:

    Function GetRoles(byval identity as WindowsIdentity) as String()

    Dim idType As Type
    idType = GetType(WindowsIdentity)
    Dim result As Object =
    idType.InvokeMember("_GetRoles",BindingFlags.Stati c Or
    BindingFlags.InvokeMethod Or BindingFlags.NonPublic,Nothing, identity, New
    Object() {identity.Token}, Nothing)
    Dim roles() As String = DirectCast(result, String())
    Return roles

    End Function

    You can use that to see the actual group list.

    The next steps after this involve looking at the user's token to examine the
    SIDs directly, but that is less easy.

    Joe K.


    "David Jessee" <DavidJessee@discussions.microsoft.com> wrote in message
    news:61A825F8-D274-47D4-93CE-D788A5D6E5EE@microsoft.com...
    > The Scope is Global, the Group Type is Security.
    >
    > Okay, folks, I'm gonna up the antie. Anyone want Fudge? Home made!!
    >
    > "Joe Kaplan (MVP - ADSI)" wrote:
    >
    >> Is the group security enabled? What type of group is it (groupType)?
    >>
    >> Joe K.
    >>
    >> "David Jessee" <DavidJessee@discussions.microsoft.com> wrote in message
    >> news:9CE609AB-6DCC-4F44-9F34-B2B5E9604529@microsoft.com...
    >> > Its just being inconsistent.
    >> >
    >> > I'm in 3 different Groups in AD.
    >> >
    >> > .IsInRole("Groupx") returns true
    >> > .IsInRole("Groupy") returns true
    >> > .IsInRole("Groupz") returns FALSE
    >> >
    >> > All of these groups reside in the same location in my AD tree, but for
    >> > some
    >> > reason, the one is returning False.
    >> >
    >> > even stranger, if I do a search for "Groupz" and list out its members
    >> > (through DirectoryServices) my account information shows up.
    >> >
    >> > I have no idea why my account is in the group, but that lookup doesn't
    >> > work
    >> > for the group, but it dows for others.
    >> >
    >> > Ideas??
    >> > Anyone??
    >> > I'm not proud, I'll beg, I'll make cheesecake!
    >>
    >>
    >>

    Joe Kaplan \(MVP - ADSI\) 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