LDAP and ADSI Authentication...
Not sure if this should be in general or API, so here goes...
I need to authenticate users for a VB6 app running on Win2000 that I'm working on. They need to: 1) be authenticated when logging into the app (i.e., they login with username and password which is their normal windows password using NT authentication); 2) Be authenticated when they perform a database write for an "electronic signature" (also using the same NT authentication).
I've heard some stirrings that LDAP and ADSI could accomplish this, but I'm not finding any information on this anywhere (including the internet). So far I can find and return a user's full name given their userID with the following code (which requires a reference to Active DS Objects):
Private Sub cmdFullName_Click()
If Me.txtUserName.Text = "" Then
MsgBox "Enter a username already!!!"
Exit Sub
End If
Dim User As IADsUser
Dim UserName As String
Dim UserDomain As String
UserDomain = "<domain>"
UserName = Me.txtUserName.Text
Set User = GetObject("WinNT://" & UserDomain & "/" & UserName & ",user")
Dim RetVal As String, strFirst As String, strLast As String
RetVal = User.FullName
Me.txtFullName = User.FullName
'Debug.Print RetVal
End Sub
It shouldn't be much of a stretch from this to writing a function that looks on the domain controller and returns true if the userID and password validates and false otherwise. I've dug through an entire 500 page book on ADSI for NT/2000 Administrators and have found nothing pertaining to Authentication (though I learned a lot of other useful & cool stuff).
Anyone ever done this or know anyone who has?
Thank you!
Ed