LDAP Authentication fails on Web Application

A

Anbu

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.SecureSocketsLayer);
}

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
 
E

Erik Funkenbusch

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top