[progress Communities] [progress Openedge Abl] Forum Post: Binding To Active Directory

  • Thread starter Thread starter stingray70m
  • Start date Start date
Status
Not open for further replies.
S

stingray70m

Guest
I'm would like to authenticate a username and password to my active directory. I've found many links using C# and one that connects me to show specific details of a user from a link below but not sure how to implement a password field into the lookup. Any help would be appreciated!! https://community.progress.com/community_groups/f/27/t/22# Sample: DEFINE VARIABLE oADContext AS System.DirectoryServices.ActiveDirectory.DirectoryContext. DEFINE VARIABLE oDirectoryEntry AS System.DirectoryServices.DirectoryEntry. DEFINE VARIABLE oSearch AS System.DirectoryServices.DirectorySearcher. DEFINE VARIABLE oResult AS System.DirectoryServices.SearchResult. DEFINE VARIABLE oenum# AS System.Collections.IEnumerator. DEFINE VARIABLE iCount AS INTEGER NO-UNDO. DEFINE VARIABLE iItem AS INTEGER NO-UNDO. DEFINE VARIABLE cUserName# AS CHARACTER NO-UNDO. DEFINE VARIABLE cPassword as character no-undo. DEFINE VARIABLE cPath# AS CHARACTER NO-UNDO. DEFINE VARIABLE cEmail AS CHARACTER NO-UNDO. oADContext = NEW System.DirectoryServices.ActiveDirectory.DirectoryContext(System.DirectoryServices.ActiveDirectory.DirectoryContextType:Domain). oDirectoryEntry = System.DirectoryServices.ActiveDirectory.Domain:GetDomain(oADContext):GetDirectoryEntry(). cUserName# = "usera". cPassword = "mypassword". oSearch = NEW System.DirectoryServices.DirectorySearcher(oDirectoryEntry,SUBSTITUTE("(&&(objectClass=user)(sAMAccountName=&1))",cUserName#)). oResult = oSearch:FindOne(). /* now I've got the complete LDAP path of the Windows user */ oDirectoryEntry = NEW System.DirectoryServices.DirectoryEntry(oResult:path). oenum# = oDirectoryEntry:Properties:GetEnumerator(). Thanks Mark

Continue reading...
 
Status
Not open for further replies.
Back
Top