Authenticating using Windows Authentication
what I am trying ot accomplish is to have the users log on using their windows account. We do want them to have to enter their user name and password. Do I need the Iuser account to have rights to active directory? Any assistance would be greatly appreciated.
Public Function IsAuthenticated(ByVal domain As String, ByVal username As String, ByVal pwd As String) As Boolean Dim domainAndUsername As String = "" domainAndUsername = domain & "\" & username Dim entry As New DirectoryEntry("LDAP://DC=ABC,DC=local", domainAndUsername, pwd) Dim obj As Object Try obj = entry.NativeObject Dim search As New DirectorySearcher(entry) Dim result As SearchResult search.Filter = "(SAMAccountName=" + username + ")" search.PropertiesToLoad.Add("cn") result = search.FindOne() If result Is Nothing Then Return False End If Catch ex As Exception Return False End Try Return True End Function

