473,473 Members | 1,847 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

LDAP Authentication fails on Web Application


Sorry for cross posting the query. But I need a resolution as early as
possible.

I have developed an application to authenticate the user based on LDAP
Search and authentication.

The Windows application that was developed using C# works fine. But it
fails when I convert this as a DLL or Web Service. I need to host the
application on a server to use the result across different applications
and on different clients.

The code looks likes this,

System.DirectoryServices.DirectoryEntry entry;
System.DirectoryServices.DirectorySearcher mySearcher;

bool success = false;
string message = "";

try
{
entry = new System.DirectoryServices.DirectoryEntry(ldap_host,
application_user, application_password,
System.DirectoryServices.AuthenticationTypes.Secur eSocketsLayer);
}

catch (Exception ex)
{
// Throws "The server is not operational error"
// Also the entry.AdsObject returns as
<error: an exception of type:
{System.Runtime.InteropServices.COMException} occurred>
}
But the server is in operations, and the code works fine with the
Desktop /Windows application.

Is there any problem with the ASPNET account? or should i really need
to do anything to make it work.

TIA

Apr 12 '06 #1
2 5633
Anbu please see this at:-
http://msdn.microsoft.com/library/de...SecNetHT02.asp
Patrick

"Anbu" <t_**************@yahoo.co.in> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.com...

Sorry for cross posting the query. But I need a resolution as early as
possible.

I have developed an application to authenticate the user based on LDAP
Search and authentication.

The Windows application that was developed using C# works fine. But it
fails when I convert this as a DLL or Web Service. I need to host the
application on a server to use the result across different applications
and on different clients.

The code looks likes this,

System.DirectoryServices.DirectoryEntry entry;
System.DirectoryServices.DirectorySearcher mySearcher;

bool success = false;
string message = "";

try
{
entry = new System.DirectoryServices.DirectoryEntry(ldap_host,
application_user, application_password,
System.DirectoryServices.AuthenticationTypes.Secur eSocketsLayer);
}

catch (Exception ex)
{
// Throws "The server is not operational error"
// Also the entry.AdsObject returns as
<error: an exception of type:
{System.Runtime.InteropServices.COMException} occurred>
}
But the server is in operations, and the code works fine with the
Desktop /Windows application.

Is there any problem with the ASPNET account? or should i really need
to do anything to make it work.

TIA

Apr 12 '06 #2
On 11 Apr 2006 20:30:47 -0700, Anbu wrote:
Sorry for cross posting the query. But I need a resolution as early as
possible.
I've never met anyone who posted something here as "Oh, I don't need an
answer for a few weeks".
I have developed an application to authenticate the user based on LDAP
Search and authentication.
Ok.
The Windows application that was developed using C# works fine. But it
fails when I convert this as a DLL or Web Service.
Hmm.. that's not what yous ay below. You say it works fine on your
machine, but fails on the server. Is it the server that fails, or the code
in a DLL that fails?
But the server is in operations, and the code works fine with the
Desktop /Windows application.
Did you test the DLL on your desktop?
Is there any problem with the ASPNET account? or should i really need
to do anything to make it work.


You don't say what server you're running it on. If it's Windows 2003, then
the default account is NETWORK SERVICE rather than ASPNET. If it's 2000
then it's ASPNET.

Also, there can be any number of other issues. Is the server in a DMZ and
firewalled from your LDAP server? Is the DNS configured the same for the
server versus your desktop? (you don't post your ldap connection string, so
hard to tell).

You could have been a *little* more vague, but not much.
Apr 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: dmcconkey | last post by:
Hi folks, I've been searching for a while and haven't found my specific question anywhere else. If this has already been asked, please accept my appologies and point me to the appropriate...
7
by: Amar | last post by:
I am trying to connect to my college LDAP directory using ASP.NET. This LDap does not have security as it returns only user demographic information. i do not need to bind with a username or...
3
by: maria.s | last post by:
Hi, I've got a problem with an LDAP query submitted from my ASP.NET application. Configuration: Windows 2003 Server Standard Ed., the application uses Windows Integrated Authentication and is...
1
by: rajens00 | last post by:
LDAP authentication fails with the final release version of ASP.Net 2.0 (and Beta 2 also). I suspect it's a legit bug. Any ideas how to report it?? The following code works fine with Framework...
2
by: P Webster | last post by:
We recently moved a web site that validated user credentials in Active Directory from IIS 5.1 to IIS 6, and the validation code no longer works. The web.config file is set to Windows authentication...
2
by: duncan beaumont | last post by:
Hi, - SQLserver 2000 - Yellowfin 2.4 - Windows 2003 server I have been asked to investigate seting up LDAP authentication to access our Yellowfin reporting.
0
by: Anbu | last post by:
Sorry for cross posting the query. But I need a resolution as early as possible. I have developed an application to authenticate the user based on LDAP Search and authentication. The Windows...
0
by: Anbu | last post by:
Sorry for cross posting the query. But I need a resolution as early as possible. I have developed an application to authenticate the user based on LDAP Search and authentication. The Windows...
2
by: schtroumfps | last post by:
Hi, I have developed an internal application in ASP.NET 2.0/C# that is using an LDAP connection. Basically, I am getting the LDAP users to match some user’s roles and rights that I have in SQL...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
1
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...
0
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...
0
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...
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.