Supporting Custom Authentication Schemes
So far we've seen how to make use of the new ASP.NET 2.0 login controls by creating an MCMS Membership Provider for Windows accounts and using it with Forms Authentication. It is also possible to use the same approach to provide a more elegant solution for "account mapping" scenarios whereby authentication takes place against an external user store.
For example, suppose we needed to use Active Directory Application Mode (ADAM) for authentication, we could implement an ADAM Membership Provider based upon our MCMSMembershipProviderBase
class by overriding the ValidateUser()method:
using System.DirectoryServices; ...Code Continues ... public override bool ValidateUser(string strName, string strPassword) { // the LDAP server to connect to string strLdapServer = "LDAP://localhost:389/"; // the DN of the OU containing the user string strLdapObj = "OU=MCMSUsers,O=TropicalGreen"; // the DirectoryEntry property to validate string strDECheck = "MCMSUsers...