Role empty in WindowsPrincipal

Discussion in 'ASP .Net Security' started by Peter Moberg, Jul 25, 2003.

  1. Peter Moberg

    Peter Moberg Guest

    Hello.

    I have a test system with one Win2003 server as a domain controller and one
    WinXP client. The domain has been setup and the WinXP client is part of the
    domain. I have added a domain user that I log on as on the WinXP client. I
    wrote a little program to see what groups the user belonged to after having
    logged in.

    this is part of the code..

    AppDomain.CurrentDomain.SetPrincipalPolicy(
    System.Security.Principal.PrincipalPolicy.WindowsPrincipal);
    System.Threading.Thread.CurrentPrincipal.IsInRole(
    System.Security.Principal.WindowsBuiltInRole.User.ToString());


    Basically Im just telling the system to make sure that the CurrentPrincipal
    returns a WindowsPrincipal type and the last statement is just to make sure
    that the roles are loaded. (I guess the .NET framework will not load all the
    roles until you call the IsInRole function)

    When I look at the CurrentPrincipal in the watch window it says that the
    user belongs to x nbr of groups. I check the groups and can see that they
    indeed are the domain groups...like Domain Users and Domain Admins...

    However I have also put the specific user in a domain local group called
    TestGroup. This one doesnt show up in the roles list for the
    WindowsPrincipal. However, there is one entry in the role list that is the
    empty string and Im wondering if there is a problem with getting to domain
    local groups?

    Does anyone know if the domain local groups will not be listed in the
    WindowsPrincipal object... or do any have any insight into this matter.

    Any help is greatly appreciated!

    Thanks,

    Peter
     
    Peter Moberg, Jul 25, 2003
    #1
    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. Kevin Burton

    WindowsPrincipal and WindowsIdentity.

    Kevin Burton, Jan 7, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    7,478
    bruce barker
    Jan 8, 2004
  2. Mark
    Replies:
    1
    Views:
    3,253
    qvo178
    Feb 23, 2010
  3. Mark

    CurrentPrincipal, WindowsPrincipal

    Mark, Jan 12, 2004, in forum: ASP .Net Security
    Replies:
    1
    Views:
    186
    zeldadog
    Jan 12, 2004
  4. naijacoder naijacoder

    WindowsPrincipal.IsInRole() problem with non-builtin roles

    naijacoder naijacoder, Aug 30, 2004, in forum: ASP .Net Security
    Replies:
    4
    Views:
    281
    Joe Kaplan \(MVP - ADSI\)
    Sep 2, 2004
  5. Vic

    isinrole reverts to windowsprincipal?

    Vic, Nov 26, 2004, in forum: ASP .Net Security
    Replies:
    0
    Views:
    169
Loading...

Share This Page