ADAM with Azman



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?

.



Relevant Pages

  • nightmare with ADAM ldap and roleprovider
    ... activedirectory membership provider to speak to one ... Ideally ADAM will be the user/group repository and Azman ... ActiveDirectoryMemberShipProvider based code to ...
    (microsoft.public.dotnet.security)
  • 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)
  • Re: SSL ADAM and XP
    ... Unfortunately I don't know anything useful about the AD membership provider ... It should be possible to find a way to augment use data in ADAM but use ... Joe Kaplan-MS MVP Directory Services Programming ... Co-author of "The .NET Developer's Guide to Directory Services Programming" ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: ADAM and Authorization and Profile Application Block
    ... recommend that you obtain the AzMan QFE that Eric ... referred to as it will allow you to use ADAM as a user store. ... and then you have to import ADAM user through its SID ...
    (microsoft.public.windows.server.active_directory)