Не удалось разрешить SID целевого участника.

Я удалил свое веб-приложение (которое использует LDAP) на сервере Windows 2016. Выдает ошибку ниже. Хотя я могу получить доступ к тому же экземпляру ADLDS с помощью консольного приложения ADSI или C # (созданная утилита для проверки подключения). Но не уверен, почему возникает ошибка с веб-приложением. Пожалуйста, предложите.

Server Error in '/' Application.

**While trying to resolve a cross-store reference, the SID of the target principal could not be resolved.  The error code is 1722.**

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.DirectoryServices.AccountManagement.PrincipalOperationException: While trying to resolve a cross-store reference, the SID of the target principal could not be resolved.  The error code is 1722.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 

[PrincipalOperationException: While trying to resolve a cross-store reference, the SID of the target principal could not be resolved.  The error code is 1722.]
   System.DirectoryServices.AccountManagement.ADStoreCtx.ResolveCrossStoreRefToPrincipal(Object o) +570
   System.DirectoryServices.AccountManagement.ADUtils.DirectoryEntryAsPrincipal(DirectoryEntry de, ADStoreCtx storeCtx) +133
   System.DirectoryServices.AccountManagement.ADDNLinkedAttrSet.get_CurrentAsPrincipal() +86
   System.DirectoryServices.AccountManagement.PrincipalCollectionEnumerator.MoveNext() +252
   System.DirectoryServices.AccountManagement.PrincipalCollectionEnumerator.System.Collections.IEnumerator.MoveNext() +9
   System.Linq.<SelectManyIterator>d__22`3.MoveNext() +65
   System.Linq.Lookup`2.Create(IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer) +264
   System.Linq.GroupedEnumerable`3.GetEnumerator() +72
   System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +63
   System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection) +392
   System.Collections.Generic.List`1.AddRange(IEnumerable`1 collection) +15
   Plastin.Common.Security.ADLDSClaimsProvider.SetApplicationClaims() +1012
   Plastin.Common.Security.ADLDSClaimsProvider.Initialise() +174
   Plastin.Common.Security.ADLDSClaimsProvider..cctor() +238

[TypeInitializationException: The type initializer for 'Plastin.Common.Security.ADLDSClaimsProvider' threw an exception.]
   lambda_method(Closure , IBuilderContext ) +81
   Microsoft.Practices.ObjectBuilder2.<>c__DisplayClass1.<GetBuildMethod>b__0(IBuilderContext context) +35
   Microsoft.Practices.ObjectBuilder2.DynamicMethodBuildPlan.BuildUp(IBuilderContext context) +10
   Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext context) +198
   Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context) +209
   Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides) +165

[ResolutionFailedException: Resolution of the dependency failed, type = "Plastin.Common.Security.IClaimsProvider", name = "(none)".
Exception occurred while: Calling constructor Plastin.Common.Security.ADLDSClaimsProvider().
Exception is: TypeInitializationException - The type initializer for 'Plastin.Common.Security.ADLDSClaimsProvider' threw an exception.
-----------------------------------------------
At the time of the exception, the container was:

  Resolving Plastin.Common.Security.ADLDSClaimsProvider,(none) (mapped from Plastin.Common.Security.IClaimsProvider, (none))
  Calling constructor Plastin.Common.Security.ADLDSClaimsProvider()
]
   Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides) +329
   Microsoft.Practices.Unity.UnityContainer.Resolve(Type t, String name, ResolverOverride[] resolverOverrides) +15
   Microsoft.Practices.Unity.UnityContainerExtensions.Resolve(IUnityContainer container, ResolverOverride[] overrides) +72
   Plastin.Common.Security.AuthenticationManager.Authenticate(String resourceName, ClaimsPrincipal incomingPrincipal) +149
   Plastin.Portal.MvcApplication.Application_PostAuthenticateRequest() +70

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +87
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +101
   System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +21
   System.Web.Util.ArglessEventHandlerProxy.Callback(Object sender, EventArgs e) +56
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +141
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

person DevX    schedule 07.03.2018    source источник


Ответы (1)


Наконец, мы исправили эту проблему, и приношу свои извинения, что опаздываю с ответом на этот вопрос. После долгой отладки мы обнаружили, что наше веб-приложение выдает эту ошибку при получении членов группы ADLDS. Это было необычно, так как одно и то же приложение работало на другом сервере. Поэтому мы решили захватить сетевой трафик с помощью Wireshark. Захват Wireshark показал, что соединение между LDAP-сервером и сервером приложений было заблокировано через SMB-порт 445. Итак, мы просим нашу сетевую команду открыть порт 445, что устранило проблему.

Эта ошибка кажется очень общей ошибкой и может быть другими причинами этой ошибки в вашем сценарии, но использование инструмента захвата сетевого трафика (например, wirehark) на ранней стадии расследования может помочь вам быстро устранить неполадки такого рода.

person DevX    schedule 29.05.2018