Network authentication

How can I have a user supply their domain creditials and have them validated by the network? user and password.
LVL 5
thenrichAsked:
Who is Participating?
 
CodeCruiserCommented:
USe following function


Function AuthenticateUser(path as String, user As String, pass As String) As Boolean
    Dim de As New DirectoryEntry(path, user, pass, AuthenticationTypes.Secure)
    Try 
        'run a search using those credentials.  
        'If it returns anything, then you're authenticated
        Dim ds As DirectorySearcher = New DirectorySearcher(de)
        ds.FindOne()
        Return True
    Catch
        'otherwise, it will crash out so return false
        Return False
    End Try 
End Function

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.