Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 1881

WCF service hosted on IIS7 cannot access Active Directory

$
0
0

Hi All,

I hope that this forum is the right place for asking my question and apologize in advance, if it isn't.

I develop a WCF service, which is supposed to authenticate a user via LDAP.
My service is hosted on IIS7, which runs on a Windows 7 Ultimate machine, and uses a.NET v4.0 application pool with the Integrated pipeline mode.
The machine establishes a VPN channel to the user domain, but the machine is not a part of this domain; the application pool runs under a local to the machine account.

The WCF service uses PrincipalContext to get the job done:

PrincipalContext l_ctx = new PrincipalContext(ContextType.Domain, "acme.local");

The call to the PrincipalContext c-tor throws the following exception:

System.DirectoryServices.AccountManagement.PrincipalServerDownException: The server could not be contacted. ---> System.DirectoryServices.Protocols.LdapException: The LDAP server is unavailable.
   at System.DirectoryServices.Protocols.LdapConnection.Connect()
   at System.DirectoryServices.Protocols.LdapConnection.SendRequestHelper(DirectoryRequest request, Int32& messageID)
   at System.DirectoryServices.Protocols.LdapConnection.SendRequest(DirectoryRequest request, TimeSpan requestTimeout)
   at System.DirectoryServices.AccountManagement.PrincipalContext.ReadServerConfig(String serverName, ServerProperties& properties)
   --- End of inner exception stack trace ---
   at System.DirectoryServices.AccountManagement.PrincipalContext.ReadServerConfig(String serverName, ServerProperties& properties)
   at System.DirectoryServices.AccountManagement.PrincipalContext.DoServerVerifyAndPropRetrieval()
   at System.DirectoryServices.AccountManagement.PrincipalContext..ctor(ContextType contextType, String name, String container, ContextOptions options, String userName, String password)
   at System.DirectoryServices.AccountManagement.PrincipalContext..ctor(ContextType contextType, String name)

I am able to ping the domain controller from the machine, but neither a sniffer on the IIS machine nor the monitoring tools on the domain side show no access to the domain controller.

I have played with different constructors of PrincipalContext, but they end up throwing the same exception.
I searched the web, but could not find an applicable answer.

At this point I am totally out of ideas or direction and the community is my only hope.

I am looking forward to any kind of assistance, and thank you all in advance.


Viewing all articles
Browse latest Browse all 1881

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>