Directory Programming .NET

Active Directory and ADAM programming support for .NET developers
Welcome to Directory Programming .NET Sign in | Join | Help

Re: Odd ADAM Authentication problem

  •  07-02-2010, 2:13 PM

    Re: Odd ADAM Authentication problem

    Did you consider just using the ActiveDirectoryMembershipProvider for this? It comes with ASP.NET since .NET 2.0 and works with ASP.NET forms auth directly. It is probably the easiest and cleanest approach.

    If you have to do this by hand, you still can. The main thing is to be sure not to conflate a bind operation with a search operation. System.DirectoryServices makes it very easy to do that, so it is often a poor choice for this type of thing. The cleanest simple code mechanism is to use SDS.Protocols and the Bind operation (which just checks credentials) or use SDS.AccountManagement and the PrincipalContext.ValidateCredentials method (which uses SDS.P under the hood as does the membership provider).

    If you really do need to do search operations in ADAM using the credentials of the users in ADAM, the easiest way to fix this is just to add the windows built-in "Authenticated Users" group to the ADAM readers role. Then, anyone who can bind successfully is a reader automatically and you should not have permissions issues for normal read operations. However, you are typically best off staying away from this pattern if possible.

    Best of luck!

View Complete Thread