cvboucher
Posts: 191
|
Posted: 05/22/2012, 9:34 AM |
|
I've done this in .Net against Active Directory. Below is my code. We have thousands of people in our AD and only want certain people to be able to log in (and want it controlled by our app users instead of our AD administrator). So I create a Users table without a password field. I set both the Login and Password to the Login column in the Users table. Then before the Login embed on the Button_DoLogin:
Dim ErrorFlag As Boolean = False
Dim entry As New System.DirectoryServices.DirectoryEntry("LDAP://csustan.edu/dc=csustan,dc=edu", Login.GetControl(Of MTTextBox)("login").Text, Login.GetControl(Of MTTextBox)("password").Text, System.DirectoryServices.AuthenticationTypes.Secure)
Try
entry.RefreshCache()
Catch ex As Exception
Login.Errors.Add(InMotion.Common.Resources.ResManager.GetString("CCS_LoginError"))
ErrorFlag = True
Finally
entry.Dispose()
End Try
If ErrorFlag=False
Then after the embed:
End If
HTH,
Craig
|