Verify User Group from ASP.NET

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

  1. #1

    Default Verify User Group from ASP.NET

    Hello,

    I'm a little uncertain about what I'm asking so please be gentle.

    I (think) I want to be able to identify and authenticate the currently
    logged on user against the Active Directory. We have a 2000 domain server
    and 2000 clients on our network.

    The idea behind it all is am storing documents in a SQL database and have a
    list of groups who can view them. If the currently logged on user is not in
    one of those groups then they should not be permitted to open the document.

    I'm using VB.NET in ASP.NET to develop with and would appreciate any ideas
    of where to look for examples of what to do.

    Thanks,

    <M>ike


    Guest

  2. Similar Questions and Discussions

    1. Contribute User unable to connect ...cannot verify your connection information
      I have a user that has a specific issue with Contribute. He was able in prior weeks able to connect - we are connecting via a LAN - with...
    2. Verify if a user exist at registration
      Hello and thanks in advance. I created a login form that sends data to another cfm page . I want to make sure that the username is not already...
    3. NDS user and group query
      Greetings! I would like to create a web page that will allow users to look at my Novell NDS tree groups and see what users are members, and look...
    4. Specify more than 1 supplementary group for a user ??
      Whenever I do: usermod -G groupname username ..... any existing supplementary group of username, as shown from /etc/group, gets removed and...
    5. how to add user group member
      Hi folks, I have problem when add user into group member with admintool it has been limited up to hundred...user (don't know how many) when i add...
  3. #2

    Default Re: Verify User Group from ASP.NET

    If you are using Windows authentication with IIS and ASP.NET (anonymous
    disabled in IIS, authentication set to Windows in web.config), then all you
    have to do is call Context.User.IsInRole("domain\group name")

    That will return true or false if the currently authenticated user is in the
    group you specified. The Windows security system does all the heavy lifting
    for you.

    If you aren't using Windows auth, this is vastly more painful, but can be
    done by looking up the user's groups programmatically.

    Joe K.

    "<M>ike" <mikedotdinnisatabraxas-ukdotcom> wrote in message
    news:ecv9ZtfWEHA.556@tk2msftngp13.phx.gbl...
    > Hello,
    >
    > I'm a little uncertain about what I'm asking so please be gentle.
    >
    > I (think) I want to be able to identify and authenticate the currently
    > logged on user against the Active Directory. We have a 2000 domain server
    > and 2000 clients on our network.
    >
    > The idea behind it all is am storing documents in a SQL database and have
    a
    > list of groups who can view them. If the currently logged on user is not
    in
    > one of those groups then they should not be permitted to open the
    document.
    >
    > I'm using VB.NET in ASP.NET to develop with and would appreciate any ideas
    > of where to look for examples of what to do.
    >
    > Thanks,
    >
    > <M>ike
    >
    >

    Joe Kaplan \(MVP - ADSI\) Guest

  4. #3

    Default Re: Verify User Group from ASP.NET

    Wow,

    That's pretty simple. Compared to the old classic ASP days, it's a doddle!

    Cheers,

    <M>ike

    "Joe Kaplan (MVP - ADSI)" <joseph.e.kaplan@removethis.accenture.com> wrote
    in message news:et7p0JhWEHA.1380@TK2MSFTNGP09.phx.gbl...
    > If you are using Windows authentication with IIS and ASP.NET (anonymous
    > disabled in IIS, authentication set to Windows in web.config), then all
    you
    > have to do is call Context.User.IsInRole("domain\group name")
    >
    > That will return true or false if the currently authenticated user is in
    the
    > group you specified. The Windows security system does all the heavy
    lifting
    > for you.
    >
    > If you aren't using Windows auth, this is vastly more painful, but can be
    > done by looking up the user's groups programmatically.
    >
    > Joe K.
    >
    > "<M>ike" <mikedotdinnisatabraxas-ukdotcom> wrote in message
    > news:ecv9ZtfWEHA.556@tk2msftngp13.phx.gbl...
    > > Hello,
    > >
    > > I'm a little uncertain about what I'm asking so please be gentle.
    > >
    > > I (think) I want to be able to identify and authenticate the currently
    > > logged on user against the Active Directory. We have a 2000 domain
    server
    > > and 2000 clients on our network.
    > >
    > > The idea behind it all is am storing documents in a SQL database and
    have
    > a
    > > list of groups who can view them. If the currently logged on user is not
    > in
    > > one of those groups then they should not be permitted to open the
    > document.
    > >
    > > I'm using VB.NET in ASP.NET to develop with and would appreciate any
    ideas
    > > of where to look for examples of what to do.
    > >
    > > Thanks,
    > >
    > > <M>ike
    > >
    > >
    >
    >

    Guest

  5. #4

    Default Re: Verify User Group from ASP.NET

    Ok,

    A slight variant of the same theme, if (for example) that I (current logged
    on user) am a member of the Administrators group and I use the IsInRole test
    against a subgroup that I have not been explicity added to but still have
    higher permissions than I will get 'False' as the result. Is there a way of
    testing overall permissions rather than explicit group names, or does this
    then start to get into problems?

    <M>ike


    Guest

  6. #5

    Default Re: Verify User Group from ASP.NET

    It sounds like what you want to do is roll up your AD groups into
    application-specific role descriptions. For example, you might want to put
    domain\admins1, domain\admins2 and domain\admins3 into a role in your
    application call Administrators.

    If that is what you want and you are using Win2K3 server for your web
    server, the best thing to check out is Authorization Manager (AzMan). It
    allows you to build application specific roles, tasks and operations and map
    them to users and groups at runtime.

    You could also build something similar in ASP.NET, but you'd have to write
    it yourself. One thing you might do is write an HttpModule that examines
    the WindowsPrincipal returned by the Windows authentication module and maps
    the user name and Windows groups into application specific roles. You would
    then create a new IPrincipal object (probably based on the GenericPrincipal
    class, but you can write your own easily if you want) that contains your
    application specific roles. Then, you would test against those roles in
    your application instead of the groups directly.

    Such a thing is more work, but might be worth it. Unfortunately I don't
    have a sample to point you towards. However, the .NET role-based
    authorization framework is very flexible and doing this kind of stuff is not
    very hard.

    Joe K.

    "<M>ike" <mikedotdinnisatabraxas-ukdotcom> wrote in message
    news:OkAS$epWEHA.1368@TK2MSFTNGP10.phx.gbl...
    > Ok,
    >
    > A slight variant of the same theme, if (for example) that I (current
    logged
    > on user) am a member of the Administrators group and I use the IsInRole
    test
    > against a subgroup that I have not been explicity added to but still have
    > higher permissions than I will get 'False' as the result. Is there a way
    of
    > testing overall permissions rather than explicit group names, or does this
    > then start to get into problems?
    >
    > <M>ike
    >
    >

    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