AD Group Memberships (MyADMembershipProvider) Question

Discussion in 'ASP .Net Security' started by Andy Melick, Oct 16, 2006.

  1. Andy Melick

    Andy Melick Guest

    All,

    I am using MyADMembershipProvider as my membership provider to authenticate
    to my application via Active Directory. I have found how I can allow / deny
    authorization for users via <authorization> section in the web.config.

    What is a method to search users membership to return all the groups they
    are a member of. This is for use in a portal and in classic asp I used to do
    the following:

    'Check to see if user is member of nco-account-admin for network tools
    access
    Set GroupObj = GetObject("WinNT://" & DomainString & "/" & GroupString)
    For each UserObj in GroupObj.Members
    If UserObj.Name = Request.Form("username") then
    session("networktools") = "true"
    else
    end if

    Next

    How do I go about doing the same thing in ASP.NET 2.0?

    Thanks in advance for any help!
     
    Andy Melick, Oct 16, 2006
    #1
    1. Advertising

  2. Andy Melick

    Joe Kaplan Guest

    We have some nice samples of this stuff in our book. There is a low level
    sample on group membership expansion in ch 10, which you can download for
    free from the link in my sig, along with the source code.

    My co-author, Ryan Dunn, also put together an experimental AD group role
    provider that integrates with the ASP.NET 2.0 role provider framework. You
    might want to take a look at that.

    Unfortunately, his blog seems to be a little hosed right now, but I'll email
    him and see if he can get it working again. Here's the link:

    http://www.dunnry.com/blog/

    --
    Joe Kaplan-MS MVP Directory Services Programming
    Co-author of "The .NET Developer's Guide to Directory Services Programming"
    http://www.directoryprogramming.net
    --
    "Andy Melick" <12.oh.us> wrote in message
    news:...
    > All,
    >
    > I am using MyADMembershipProvider as my membership provider to
    > authenticate to my application via Active Directory. I have found how I
    > can allow / deny authorization for users via <authorization> section in
    > the web.config.
    >
    > What is a method to search users membership to return all the groups they
    > are a member of. This is for use in a portal and in classic asp I used to
    > do the following:
    >
    > 'Check to see if user is member of nco-account-admin for network tools
    > access
    > Set GroupObj = GetObject("WinNT://" & DomainString & "/" & GroupString)
    > For each UserObj in GroupObj.Members
    > If UserObj.Name = Request.Form("username") then
    > session("networktools") = "true"
    > else
    > end if
    >
    > Next
    >
    > How do I go about doing the same thing in ASP.NET 2.0?
    >
    > Thanks in advance for any help!
    >
     
    Joe Kaplan, Oct 16, 2006
    #2
    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. Mike

    Creating site memberships

    Mike, Apr 29, 2004, in forum: HTML
    Replies:
    5
    Views:
    393
    Long - CM web hosting
    Apr 29, 2004
  2. Akaketwa
    Replies:
    1
    Views:
    4,965
    impaler
    Sep 22, 2006
  3. Jonathan Wood

    Help with ASP.NET Memberships

    Jonathan Wood, Oct 15, 2007, in forum: ASP .Net
    Replies:
    13
    Views:
    577
    Scott M.
    Oct 18, 2007
  4. Cross Forest Group Memberships

    , Feb 4, 2006, in forum: ASP .Net Security
    Replies:
    12
    Views:
    782
    Dominick Baier [DevelopMentor]
    Feb 8, 2006
  5. Ron

    Roles and Memberships

    Ron, May 16, 2006, in forum: ASP .Net Security
    Replies:
    1
    Views:
    130
    PeterKellner
    May 18, 2006
Loading...

Share This Page