Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / May 2004

Tip: Looking for answers? Try searching our database.

PLEASE HELP!!! LDAP authentication

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
walter - 04 May 2004 13:45 GMT
Hi All

I am trying to Authenticate a user from Novell LDAP using the code below. I
can successfully Connect to the LDAP Server, but get the following error
message as soon as I hit the search command:- (a) Server did not send any
data.

Imports System
Imports System.Text
Imports System.Collections
Imports System.DirectoryServices

Public Function AuthenticateUser(ByVal Username As String, ByVal Password As
String) As Collection
       Dim dirSearch As New DirectorySearcher
       Dim resultSet As SearchResultCollection
       Dim result As SearchResult
       Dim resultFields() As String = {"SecurityEquals", "cn"}

       With dirSearch
           .SearchRoot = New DirectoryEntry("server1.com", "username",
"password")
           .PropertiesToLoad.AddRange(resultFields)
           .Filter = "cn=*"
       End With

       Try
           resultSet = dirSearch.FindAll()
           If (resultSet.Count > 0) Then
               For Each result In resultSet
                   '// display results here
               Next
           Else
               '// display error message
           End If
       Catch ex As Exception
           throw ex
       Finally
           dirSearch = Nothing
       End Try
   End Function
Marc Scheuner [MVP ADSI] - 04 May 2004 14:25 GMT
>        With dirSearch
>            .SearchRoot = New DirectoryEntry("server1.com", "username",
>"password")

Well, for starters, this is DEFINITELY *NOT* a valid LDAP path here!

Check out your LDAP paths - you'd have to have something like
LDAP://dc=server1,dc=com as your first parameter to the
"DirectoryEntry" constructor here.

Marc
================================================================
Marc Scheuner                        May The Source Be With You!
Bern, Switzerland                         m.scheuner(at)inova.ch

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.