PDA

Click to See Complete Forum and Search --> : Using Built-in Windows Auth


EagleEye
Jan 6th, 2003, 07:55 AM
I want to make users login to my programs but do not want them to have to remember another password. I don't want them to have to logoff the current windows session either.

Example:

Worker A is logged into windows but Manager 1 needs to show User A a report that he does not have permission to bring up. So, using the same login and password that is used to log into windows Manager 1 logs into the program and pulls up the report while Worker A remains logged into the computer.

Anyone know how verify windows 200 users/passwords using VB.net?

Edneeis
Jan 6th, 2003, 11:54 AM
If there is its with the Principal and Identity objects in the System.Security namespace, try searching the help for 'Impersonating and Reverting'.

Jeremy Martin
Jan 6th, 2003, 05:51 PM
This may do what you want.


Public Function VerityUser(ByVal UserName As String, ByVal Password As String, ByVal Domain As String) As Boolean
Try
Dim Entry As DirectoryEntry = New DirectoryEntry("LDAP://" & Domain, UserName, Password)
Dim Search As DirectorySearcher = New DirectorySearcher(Entry)
Dim results As SearchResult
results = Search.FindOne
Return True
Catch Err As Exception
Return False
End Try
End Function


Jeremy