I'm beginning to work with OpenLDAP, and created a basic ASP.NET (VB) page to try & open a connection.
"The LDAP server is unavailable" is always the response.
Here's my code (IP address and other items changed obviously):
Imports System.DirectoryServices.Protocols
Imports System.Net
Public Class WebForm1
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub ASPxButton1_Click(sender As Object, e As EventArgs) Handles ASPxButton1.Click
Using ldap As New LdapConnection("LDAP://999.99.99.99/")
Try
ldap.SessionOptions.SecureSocketLayer = False
ldap.AuthType = AuthType.Basic
ldap.Bind(New NetworkCredential("cn=admin,dc=group,dc=net", "pwd"))
ASPxLabel1.Text = "Connected to OpenLDAP"
Catch lex As LdapException
ASPxLabel1.Text = String.Format("LDAP Error: {0} - ", lex.Message, lex.ServerErrorMessage)
Catch ex As Exception
ASPxLabel1.Text = ex.Message
End Try
End Using
End Sub
End Class
NM, there was a misconfiguration on IPTables that was blocking me.
Thanks for your kind feedback. I come here to confirm and close this issue, if you have anthing urgent in your programming, please feedback by creating another thread.
With regards
Please mark the replies as answers if they help or unmark if not.
Feedback to us
BFarley65
Member
22 Points
22 Posts
Connectionstring for OpenLDAP not working
Feb 22, 2013 07:54 PM|LINK
I'm beginning to work with OpenLDAP, and created a basic ASP.NET (VB) page to try & open a connection.
"The LDAP server is unavailable" is always the response.
Here's my code (IP address and other items changed obviously):
Imports System.DirectoryServices.Protocols Imports System.Net Public Class WebForm1 Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load End Sub Protected Sub ASPxButton1_Click(sender As Object, e As EventArgs) Handles ASPxButton1.Click Using ldap As New LdapConnection("LDAP://999.99.99.99/") Try ldap.SessionOptions.SecureSocketLayer = False ldap.AuthType = AuthType.Basic ldap.Bind(New NetworkCredential("cn=admin,dc=group,dc=net", "pwd")) ASPxLabel1.Text = "Connected to OpenLDAP" Catch lex As LdapException ASPxLabel1.Text = String.Format("LDAP Error: {0} - ", lex.Message, lex.ServerErrorMessage) Catch ex As Exception ASPxLabel1.Text = ex.Message End Try End Using End Sub End ClassBFarley65
Member
22 Points
22 Posts
Re: Connectionstring for OpenLDAP not working
Feb 22, 2013 08:09 PM|LINK
Additional info:
BFarley65
Member
22 Points
22 Posts
Re: Connectionstring for OpenLDAP not working
Feb 22, 2013 08:15 PM|LINK
NM, there was a misconfiguration on IPTables that was blocking me.
Angie xu - M...
All-Star
20273 Points
1728 Posts
Microsoft
Re: Connectionstring for OpenLDAP not working
Feb 24, 2013 11:29 PM|LINK
Hi BFarley
Thanks for your kind feedback. I come here to confirm and close this issue, if you have anthing urgent in your programming, please feedback by creating another thread.
With regards
Feedback to us
Develop and promote your apps in Windows Store