|
-
Nov 27th, 2002, 10:34 AM
#1
Thread Starter
Lively Member
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
Last edited by ewomack; Nov 27th, 2002 at 10:39 AM.
-
Nov 27th, 2002, 01:29 PM
#2
Thread Starter
Lively Member
This question was answered on another post with the following link:
http://www.experts-exchange.com/Prog..._20069893.html
Seahag posted this link and he gave credit to someone else (sorry, don't remember) for bringing the link to the foum's attention.
The program this links to uses API calls to validate a username and password (after altering the code slightly - it's completely explained at the linksite) against the domain. It works on Win2000 and is supposed to work on Win9x and NT (I've only used it on Win2000).
It has been working great for me so far.
It doesn't use LDAP or ADSI, but that's okay - I'm just happy it does what I want it to.
Thank you!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|