PrincipalContext抛出对象引用未设置为实例

时间:2016-02-10 19:46:10

标签: c# authentication active-directory ldap principalcontext

 var path = abcdev.xyz.com:636;
 PrincipalContext context = new PrincipalContext(ContextType.Domain, path)

 Error:Object reference not set to an instance of an object.

   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)
   at Authenticate(String userName, String password) in c:~\LdapRepository.cs:line 43
   at xyz.Web.LdapController.Login(LdapViewModel model) in C:~\Controllers\LdapController.vb:line 29

PrincipalContext适用于所有客户端,除了一个..我能够使用Softerra LDAP连接到path = abcdev.xyz.com:636但不确定为什么它抛出null对象引用...我试过了abcdev.xyz.com:636/dc=xyz,dc=com - 错误服务器无法连接

客户端提供的网址 - ldaps://abcdev.xyz.com:636 客户已经验证我们的IP是白色列出因此不确定我应该为这个客户尝试什么不同。

0 个答案:

没有答案