C# 跨域ASP.Net的UserPrincipal.IsMemberOf(GroupPrincipal)
我期待着修改一个网站,以验证跨域,但它给出了以下错误时,运行和登录作为用户从其他域。您能否建议需要对ASP.Net应用程序池应用什么安全设置才能启用此功能C# 跨域ASP.Net的UserPrincipal.IsMemberOf(GroupPrincipal),c#,asp.net,principalcontext,groupprincipal,C#,Asp.net,Principalcontext,Groupprincipal,我期待着修改一个网站,以验证跨域,但它给出了以下错误时,运行和登录作为用户从其他域。您能否建议需要对ASP.Net应用程序池应用什么安全设置才能启用此功能 The user name or password is incorrect [DirectoryServicesCOMException (0x8007052e): The user name or password is incorrect. ] System.DirectoryServices.DirectoryEntry.B
The user name or password is incorrect
[DirectoryServicesCOMException (0x8007052e): The user name or password is incorrect.
]
System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) +596521
System.DirectoryServices.DirectoryEntry.Bind() +44
System.DirectoryServices.DirectoryEntry.RefreshCache(String[] propertyNames) +77
System.DirectoryServices.AccountManagement.ADStoreCtx.LoadDomainInfo() +872
System.DirectoryServices.AccountManagement.ADStoreCtx.get_UserSuppliedServerName() +129
System.DirectoryServices.AccountManagement.ADStoreCtx.IsMemberOfInStore(GroupPrincipal g, Principal p) +976
[AuthenticationException: The user name or password is incorrect.
]
System.DirectoryServices.AccountManagement.ADStoreCtx.IsMemberOfInStore(GroupPrincipal g, Principal p) +2103
正在运行的代码-仅显示与查询相关的对象
string Domain = userName.Split('\\')[0];
var pc = new PrincipalContext(ContextType.Domain, Domain);
var gpGeneral = GroupPrincipal.FindByIdentity(pc, "GroupName");
up.IsMemberOf(gpGeneral)