nightmare with ADAM ldap and roleprovider

steven_at_sbcanada.com
Date: 09/16/05


Date: 15 Sep 2005 15:00:13 -0700

What a nightmare! I've spent 5 days trying to get AZMAN and the .net
2.0 activedirectory (for ADAM) membership provider to speak to one
another. Ideally ADAM will be the user/group repository and Azman
will, through LDAP Query Groups, allow for fine grained access
control.. All via .NET 2.0, using Membership provider classes and
controls....

Heres the problem:

I have gotten Azman running in ADAM (Residing on
CN=AzMan,DC=TestApp,DC=com).
Then I instructed ActiveDirectoryMembershipProvider to use
 a container, one level deeper than the AzMan store (just for
prototyping purposes) CN=UserStore,CN=AzMan,DC=TestApp,DC=com"/>
(UserStore is just a simple container) [note I've tried many partitions

and configurations and nothing seems to help!]

The Asp.net 2.0 membership provider can create users in this partition
with no problem but it wont let me create roles... (throws an
Exception from HRESULT: 0x8007006E)).

Anyways, the bigger problem I am having is that I want my
ActiveDirectoryMemberShipProvider based code (snippet below) to
construct a clientContext using the SID of the authenticated ADAM user.

 Everything seems to work until the point where a clientContext has to
be created and suddenly I'm getting
Exception from HRESULT 'clientContext.UserCanonical' threw an
exception
of type

'System.Runtime.InteropServices.COMException' string

{System.Runtime.InteropServices.COMException}
 "The request is not supported. (Exception from HRESULT:
0x80070032)"} System.SystemException

{System.Runtime.InteropServices.COMException}

Seems like the ClientContext is improperly constructed. Without a
valid ClientContext the code cannot do any auth checks... I'm betting

this has to do with the fact that the RoleProvider is unable to create
Roles.

Heres the code, I hope someone can tell me where I'm going wrong...
****

 protected void Page_Load(object sender, EventArgs e)
    {
        MembershipUser user = Membership.GetUser();

        System.Security.Principal.SecurityIdentifier sidValue =

(System.Security.Principal.SecurityIdentifier)user.ProviderUserKey;

     string sid = sidValue.ToString();

    AzAuthorizationStoreClass AzManStore = new
AzAuthorizationStoreClass();
        AzManStore.Initialize(0,

ConfigurationManager.ConnectionStrings["AzManServer"].ConnectionString,

null);
        IAzApplication azApp =
AzManStore.OpenApplication("TestApplicationStore", null);

 //until now, other than the inability to call
Roles.CreateRole("TestRole") there are no problems..... Here comes the

problem (symptom?):

        IAzClientContext clientContext =

        azApp.InitializeClientContextFromStringSid(sid,

(int)tagAZ_PROP_CONSTANTS.AZ_CLIENT_CONTEXT_SKIP_GROUP, null);

//now if I try to do:
        Response.Write(clientContext.UserDisplay);

//At this point the ClientContext is not null but is quite useless.

     .......

    }
Any ideas? Is it a bug in my code or config error? A bug in the beta?
 The fact that I'm not connected via SSL? A permissions issue of some
sort?



Relevant Pages

  • ADAM with Azman
    ... activedirectory membership provider to speak to one ... Ideally ADAM will be the user/group repository and Azman ... construct a clientContext using the SID of the authenticated ADAM user. ...
    (microsoft.public.windows.server.active_directory)
  • Re: MS ADAM: How strategic is a) MS ADAM and b) Authorizaion Manager?
    ... I hadn't found ActiveDirectoryMembershipProvider in any of the TechEd talks ... What about Roles and Profiles? ... I think the issue here is that AzMan is a much ... >> ADAM or AzMan as a ASP.NET 2.0 provider for these 3 services. ...
    (microsoft.public.windows.server.active_directory)
  • Re: MS ADAM: How strategic is a) MS ADAM and b) Authorizaion Manager?
    ... Did you look at the ActiveDirectoryMembershipProvider for ASP.NET 2.0? ... The AzMan/Membership story isn't as good, ... > ADAM or AzMan as a ASP.NET 2.0 provider for these 3 services. ...
    (microsoft.public.windows.server.active_directory)
  • Re: ADAM : Beginner and need help
    ... AzMan probably isn't a good solution for Java, but the AzMan design might be ... ADAM also supports the AD "tokenGroups" attribute which can be used to ... Co-author of "The .NET Developer's Guide to Directory Services Programming" ... ADAM can also support lots of password policy features that Windows ...
    (microsoft.public.windows.server.active_directory)
  • Re: Bug in ADAM/AzMan integration? Roles placed in AzTaskObjectContain
    ... > in an ADAM partition. ... AzMan MMC and the role was created in the AzRoleObjectContainer ... > an AzMan store in ADAM. ...
    (microsoft.public.windows.server.active_directory)