By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,740 Members | 790 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,740 IT Pros & Developers. It's quick & easy.

LDAP Authentication fails on Web Application

P: n/a

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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.