Hello
I'm currently working on a 3rd project using Active
Directory integration. I used it in DotNetNuke modules before and never
got it to work on our network, but miraculously it did work on the
clients network, so no harm done.
The problem is that I'm working
on a tool for internal use now, and that the connection with OUR Active
Directory should work this time. So I started off... I'm looking for
the answer to my problems for over a week now and still haven't come up
with anything that works. Last friday I was able to use 1 function
(Membership.ValidateUser) without an error... but now even that
function gives me an error. Funny thing is: I can use the ldp.exe tool
on my computer, and it works... when I code something in my
application, it doesn't. Strictly for the record, I am making a
winforms tool, not a webform. So technically this post doesn't belong
here, but I can't find a better place to ask about it, since the
combination of a winforms with MembershipProvider seems to be as rare
as the Loch Ness monster.
Anyway, I'm using the LDAP string from
the ldp.exe tool (LDAP://server.abc.local/DC=ABC,DC=LOCAL) and provide
the same username/password (a domain admin) that I did with the ldp.exe
tool. The error I can't seem to get around is "The server is not
operational" or in some cases "Cannot establish a trusted relationship
between the workstation and the primary domain". Currently I'm testing
this with DirectoryEntry, just to see if I can at least get a
connection, so that I can use that to fix the MembershipProvider.
I also tried this:
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
bool bResult = Thread.CurrentPrincipal.IsInRole("Employees");
Which was the first thing I got working, but somewhere during the weekend this also died :-(
Can anyone help me out with this?
- Varcour