asp.net - LDAP Authentication from .NET using Proxy User -
Text after "
We want to connect to an LDAP server (Active Directory, Novell, or otherwise) to use "Proxy User" and Make sure that the user has typed in an acceptable username and password while trying to sign in. I have the code correct to connect to LDAP, but I'm at a loss how to check the user name and password. Switch to? If you can do this through the LDAP query
Here is the courage of my code:
public function authenticated (ByVal username string, ByVal password string As in) Dim String = Configuration Manager Dim Proxy User Name String = Configuration Manager as AppSettings ("LDAPServer"). Dim Proxy Password String = Configuration Manager as AppSettings ("LDAPProxyUser"). AppSettings ("LDAPProxyPassword") DirectoryEntry entry as a slow entry = New directory entry (LDAP server, proxyUN name, proxyPassword) 'This display LDAP authentication' as obj dormant object = entry.NativeObject Dynamic Search as New DirectorySearcher ( Login) search.Filter = String.Format ("(SAMAccountName = {0})", user name) 'How do I now check the password? 'SearchResult = search.FindOne (as a result of a slow result) If nothing is the result then then throw a new exception ("SAMAccountName unable to find")
The code I used to try to bind to LDAP using the old credentials. Calls an exception to the call, so you do not need a valid user:
Comments
Post a Comment