using AspNetActiveDirectoryMembershipProvider question

Discussion in 'ASP .Net Security' started by Patrick.O.Ige, Aug 28, 2006.

  1. As anybody here used the AspNetActiveDirectoryMembershipProvider with the
    SiteMap

    For example mapping the roles from Active Directory to the siteMapNode for
    security trimming?

    What i mean is that for example below i have "roles="members"
    is it possible to map AD roles to that directly?

    So for example if someone with an Admin role logs in they would see more
    link than a user
    and i can just add Roles from the AD to the siteMapNodes.

    Is this possible?



    <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
    <siteMapNode url="~/default.aspx" title="Home" description=""
    roles="*">
    <siteMapNode url="~/signup.aspx" title="Sign Up" description=""
    roles="?" />
    <siteMapNode url="~/pwdreminder.aspx" title="Forgot Password"
    description="" />

    <siteMapNode url="" title="User Settings" description=""
    roles="users">
    <siteMapNode url="~/_Users/myaccount.aspx" title="My Account"
    description="" />
    <siteMapNode url="~/_Users/changepwd.aspx" title="Reset Password"
    description="" />
    </siteMapNode>

    <siteMapNode url="" title="Members" description="" roles="members">
    <siteMapNode url="~/_Members/history.aspx" title="History"
    description="" />
    </siteMapNode>

    <siteMapNode url="" title="Support" description="" roles="support">
    <siteMapNode url="~/_Support/search.aspx" title="Search"
    description="" />
    </siteMapNode>
    <siteMapNode url="" title="Admin" description="" roles="admins">
    <siteMapNode url="~/_Admins/test.aspx" title="Admin1"
    description="" />
    <siteMapNode url="~/_Admins/test2.aspx" title="Admin2"
    description="" />
    </siteMapNode>
    </siteMapNode>
    </siteMap>

    Any ideas?
    Patrick.O.Ige, Aug 28, 2006
    #1
    1. Advertising

  2. Hi,

    if you set securityTrimmingEnabled in the sitemap provider, it will read
    from the <authorization> section(s) to determine which links to display to
    the user in the navigation.

    The roles attribute in the sitemap file is used to override the authorization
    setting - you can use AD groups (both in authorization and sitemap) - use
    the Domain\Groupname format.

    ---
    Dominick Baier, DevelopMentor
    http://www.leastprivilege.com

    > As anybody here used the AspNetActiveDirectoryMembershipProvider with
    > the SiteMap
    >
    > For example mapping the roles from Active Directory to the siteMapNode
    > for security trimming?
    >
    > What i mean is that for example below i have "roles="members" is it
    > possible to map AD roles to that directly?
    >
    > So for example if someone with an Admin role logs in they would see
    > more
    > link than a user
    > and i can just add Roles from the AD to the siteMapNodes.
    > Is this possible?
    >
    > <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"
    > >

    > <siteMapNode url="~/default.aspx" title="Home" description=""
    > roles="*">
    > <siteMapNode url="~/signup.aspx" title="Sign Up" description=""
    > roles="?" />
    > <siteMapNode url="~/pwdreminder.aspx" title="Forgot Password"
    > description="" />
    > <siteMapNode url="" title="User Settings" description=""
    > roles="users">
    > <siteMapNode url="~/_Users/myaccount.aspx" title="My Account"
    > description="" />
    > <siteMapNode url="~/_Users/changepwd.aspx" title="Reset
    > Password"
    > description="" />
    > </siteMapNode>
    > <siteMapNode url="" title="Members" description=""
    > roles="members">
    > <siteMapNode url="~/_Members/history.aspx" title="History"
    > description="" />
    > </siteMapNode>
    > <siteMapNode url="" title="Support" description=""
    > roles="support">
    > <siteMapNode url="~/_Support/search.aspx" title="Search"
    > description="" />
    > </siteMapNode>
    > <siteMapNode url="" title="Admin" description="" roles="admins">
    > <siteMapNode url="~/_Admins/test.aspx" title="Admin1"
    > description="" />
    > <siteMapNode url="~/_Admins/test2.aspx" title="Admin2"
    > description="" />
    > </siteMapNode>
    > </siteMapNode>
    > </siteMap>
    > Any ideas?
    >
    Dominick Baier, Aug 28, 2006
    #2
    1. Advertising

  3. Thanks alot

    "Dominick Baier" <dbaier@pleasepleasenospam_leastprivilege.com> wrote in
    message news:...
    > Hi,
    > if you set securityTrimmingEnabled in the sitemap provider, it will read
    > from the <authorization> section(s) to determine which links to display to
    > the user in the navigation.
    >
    > The roles attribute in the sitemap file is used to override the
    > authorization setting - you can use AD groups (both in authorization and
    > sitemap) - use the Domain\Groupname format.
    >
    > ---
    > Dominick Baier, DevelopMentor
    > http://www.leastprivilege.com
    >
    >> As anybody here used the AspNetActiveDirectoryMembershipProvider with
    >> the SiteMap
    >>
    >> For example mapping the roles from Active Directory to the siteMapNode
    >> for security trimming?
    >>
    >> What i mean is that for example below i have "roles="members" is it
    >> possible to map AD roles to that directly?
    >>
    >> So for example if someone with an Admin role logs in they would see
    >> more
    >> link than a user
    >> and i can just add Roles from the AD to the siteMapNodes.
    >> Is this possible?
    >>
    >> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"
    >> >

    >> <siteMapNode url="~/default.aspx" title="Home" description=""
    >> roles="*">
    >> <siteMapNode url="~/signup.aspx" title="Sign Up" description=""
    >> roles="?" />
    >> <siteMapNode url="~/pwdreminder.aspx" title="Forgot Password"
    >> description="" />
    >> <siteMapNode url="" title="User Settings" description=""
    >> roles="users">
    >> <siteMapNode url="~/_Users/myaccount.aspx" title="My Account"
    >> description="" />
    >> <siteMapNode url="~/_Users/changepwd.aspx" title="Reset
    >> Password"
    >> description="" />
    >> </siteMapNode>
    >> <siteMapNode url="" title="Members" description=""
    >> roles="members">
    >> <siteMapNode url="~/_Members/history.aspx" title="History"
    >> description="" />
    >> </siteMapNode>
    >> <siteMapNode url="" title="Support" description=""
    >> roles="support">
    >> <siteMapNode url="~/_Support/search.aspx" title="Search"
    >> description="" />
    >> </siteMapNode>
    >> <siteMapNode url="" title="Admin" description="" roles="admins">
    >> <siteMapNode url="~/_Admins/test.aspx" title="Admin1"
    >> description="" />
    >> <siteMapNode url="~/_Admins/test2.aspx" title="Admin2"
    >> description="" />
    >> </siteMapNode>
    >> </siteMapNode>
    >> </siteMap>
    >> Any ideas?
    >>

    >
    >
    Patrick.O.Ige, Aug 28, 2006
    #3
    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. William F. Robertson, Jr.
    Replies:
    1
    Views:
    973
    Kathy Burke
    Jun 25, 2003
  2. pete
    Replies:
    1
    Views:
    2,936
    Jon Yates
    Aug 29, 2003
  3. Patrick.O.Ige
    Replies:
    0
    Views:
    639
    Patrick.O.Ige
    Aug 23, 2006
  4. =?Utf-8?B?SmF5YXNocmVlIEtyaXNobmE=?=

    Cannot get AspNetActiveDirectoryMembershipProvider working !!!

    =?Utf-8?B?SmF5YXNocmVlIEtyaXNobmE=?=, Oct 6, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    3,671
    =?Utf-8?B?SmF5YXNocmVlIEtyaXNobmE=?=
    Oct 10, 2006
  5. David Thielen
    Replies:
    8
    Views:
    556
    Luke Zhang [MSFT]
    Mar 23, 2006
Loading...

Share This Page