473,796 Members | 2,573 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The server is not operational while accessing LDAP Server

1 New Member
I have created Login.aspx Page On Click of Login Button.I invoke the code as follows
=============== =============== =============== =========
Dim adPath As String = "LDAP://172.21.1.19" 'Path to your LDAP directory server
Dim adAuth As New Authentication. FormsAuth.LDapA uthentication(a dPath)
Try
If (True = adAuth.IsAuthen ticated(txtDoma in.Text, txtUsername.Tex t, txtPassword.Tex t)) Then
Dim groups As String = adAuth.GetGroup s()

'Create the ticket, and add the groups.
Dim isCookiePersist ent As Boolean = chkPersist.Chec ked
Dim authTicket As FormsAuthentica tionTicket = New FormsAuthentica tionTicket(1, _
txtUsername.Tex t, DateTime.Now, DateTime.Now.Ad dMinutes(60), isCookiePersist ent, groups)

'Encrypt the ticket.
Dim encryptedTicket As String = FormsAuthentica tion.Encrypt(au thTicket)

'Create a cookie, and then add the encrypted ticket to the cookie as data.
Dim authCookie As HttpCookie = New HttpCookie(Form sAuthentication .FormsCookieNam e, encryptedTicket )

If (isCookiePersis tent = True) Then
authCookie.Expi res = authTicket.Expi ration
End If
'Add the cookie to the outgoing cookies collection.
Response.Cookie s.Add(authCooki e)

'You can redirect now.
Response.Redire ct(FormsAuthent ication.GetRedi rectUrl(txtUser name.Text, False))

Else
errorLabel.Text = "Authentica tion did not succeed. Check user name and password."
End If

Catch ex As Exception
errorLabel.Text = "Error authenticating. " & ex.Message
End Try
End Sub

=============== =============== =============== =============I have set LDAP Path to my Server IP Address

Now In IsAuthenticated Method I am calling the code as follows

=============== =============== ========
Dim domainAndUserna me As String = domain & "\" & username
'Dim domainAndUserNa me As String = username
Dim entry As DirectoryEntry = New DirectoryEntry( _path, domainAndUserna me, pwd, AuthenticationT ypes.Secure)

Try
'Bind to the native AdsObject to force authentication.
Dim obj As Object = entry.NativeObj ect
Dim search As DirectorySearch er = New DirectorySearch er(entry)

search.Filter = "(SAMAccountNam e=" & username & ")"
search.Properti esToLoad.Add("c n")
Dim result As SearchResult = search.FindOne( )

If (result Is Nothing) Then
Return False
End If

'Update the new path to the user in the directory.
_path = result.Path
_filterAttribut e = CType(result.Pr operties("cn")( 0), String)

Catch ex As Exception
Throw New Exception("Erro r authenticating user. " & ex.Message)
End Try

Return True


=============== =============== ===
But on the following line i am getting error called "The server is not operational"

Dim entry As DirectoryEntry = New DirectoryEntry( _path, domainAndUserna me, pwd, AuthenticationT ypes.Secure)


Any solution on this problem will be appreciated

Thanks in Advance
Mar 13 '07 #1
1 19984
kenobewan
4,871 Recognized Expert Specialist
The most common cause of this error is when the server that you are trying to contact is down. Next on the list would be it has a firewall that is blocking you, the path is incorrect so it doesn't exist or binding syntax errors.

Hope that this helps.
Mar 14 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1632
by: jiing | last post by:
<?php $ldapServer="ldap://192.168.1.211"; $ldapPort="389"; $ldapconn=ldap_connect($ldapServer,$ldapPort); $ldaprdn="uid=root, ou=People, dc=aitc, dc=com, dc=tw"; $ldappass="abcd"; if($ldapconn){ echo "connect to ".$ldapServer." successfully \n<br>"; }else{
0
1240
by: Andy Leszczynski | last post by:
Hi, I am looking for a Python barebones for a simple LDAP server project. It does not have to be Twisted based, but it would be wonderful if it is. I need a very simple server which is listening on some port and accepts following LDAP messages: -bind -search -unbind
1
3531
by: mel finney | last post by:
Hi I am trying to access a LDAP server with ASP with no sucess. I can do it with ColdFusion but not ASP. All the examples I have seen so far do not use passwords or userid's. My LDAP server requires password and user credentials. Can anyone point me in the right direction Mel
1
2456
by: Pixaar | last post by:
hello.. I am new to VB and really new to LDAP I am trying to write an application for our lunch card system...where a student's card is read by a barcode reader and the information (a string) is sent to the LDAP and some attribute value is accessed. here's the BaseDN:- ou=test1,dc=ky,dc=local LDAP server:- ldapone.ky.local
0
1637
by: crossroadsk | last post by:
I have a problem in configuring JNDI properties for LDAP server i created jndi.properties file in the current directory where i'm running a simple java code. jndi.properties file which i created consists the following: java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory java.naming.provider.url=ldap://localhost:389 and i'm using j2eeRI 1.3 to run the following code: filename : JNDILookupAny.java
3
4038
by: RJN | last post by:
Hi I've written a code that queries Windows LDAP server and works fine, but the same doesn't work when querying Solaris LDAP server. DirectoryEntry de = new DirectoryEntry("LDAP://server.com"); DirectorySearcher ds = new DirectorySearcher(de); de.Username = "xxx"; de.Password = "yyy"; de.AuthenticationType = AuthenticationTypes.Secure;
3
18724
by: eleland | last post by:
I am trying to bind to an LDAP server using php without success. I have a linux server running php compiled with open ldap. I am using the following code taken right from php.net: echo "<h3>LDAP query test</h3>"; echo "Connecting ..."; $ds=ldap_connect("ldap.berkeley.edu"); // must be a valid LDAP server! echo "connect result is ".$ds."<p>"; if ($ds) { echo "Binding ..."; $r=ldap_bind($ds); // this is an...
0
1228
LeoTD
by: LeoTD | last post by:
Dear all, I have a some problem when connect and get data from LDAP server using PHP. My PHP server use Linux. Example: I have field ObjectID in LDAP server with value is string 32 character hexa: 087DC5C2D6DD6D4BA2405F1D0E7285C8. But when I connect to LDAP server and get data, the value of field ObjectID display is: }ÅÂÖÝMK¢@_R…È I want to get result with 32 character hexa, Please help me to fix...
1
8357
by: sowing | last post by:
I am trying to bind to a LDAP server, but failed. Code as follow: #!/usr/bin/perl use strict; use warnings; use Net::LDAP; use Data::Dumper; use Net::LDAP::Util qw(ldap_error_name ldap_error_text);
0
9684
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10459
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10182
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10017
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9055
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7552
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6793
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.