пользователь объявления не может войти в систему даже при назначении роли sitecore\Sitecore Client Users

Я интегрировал модуль Active Directory с sitecore, я могу видеть пользователей из объявления в диспетчере пользователей sitecore. Теперь я хочу проверить, может ли пользователь объявления войти в sitecore. Я назначил пользователю роль sitecore\Sitecore Client Users и попытался войти в систему как

Имя пользователя: домен\имя пользователя Пароль: pw

Я вижу странную ошибку при нажатии кнопки входа в систему. Ниже ошибка.

Но когда я устанавливаю флажок «Установить как администратора» для этого пользователя, я могу войти в систему с именем пользователя: домен \ имя пользователя, пароль: pw

Любая помощь приветствуется. Спасибо.

Server Error in '/' Application.

Creating an instance of the COM component with CLSID {080D0D78-F421-11D0-A36E-00C04FB950DC} from the IClassFactory failed due to the following error: 800401e4 Invalid syntax (Exception from HRESULT: 0x800401E4 (MK_E_SYNTAX)).

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.Runtime.InteropServices.COMException: Creating an instance of the COM component with CLSID {080D0D78-F421-11D0-A36E-00C04FB950DC} from the IClassFactory failed due to the following error: 800401e4 Invalid syntax (Exception from HRESULT: 0x800401E4 (MK_E_SYNTAX)).

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: 


[COMException (0x800401e4): Creating an instance of the COM component with CLSID {080D0D78-F421-11D0-A36E-00C04FB950DC} from the IClassFactory failed due to the following error: 800401e4 Invalid syntax (Exception from HRESULT: 0x800401E4 (MK_E_SYNTAX)).]
   System.Web.Security.DirectoryInformation.GetADsPath(String dn) +108
   System.Web.DataAccess.ActiveDirectoryConnectionHelper.GetDirectoryEntry(DirectoryInformation directoryInfo, String objectDN, Boolean revertImpersonation) +42
   System.Web.Security.ActiveDirectoryMembershipProvider.ValidateUserCore(String username, String password) +1970
   System.Web.Security.ActiveDirectoryMembershipProvider.ValidateUser(String username, String password) +39
   LightLDAP.SitecoreADMembershipProvider.ValidateUser(String username, String password) +193
   Sitecore.Data.DataProviders.NullRetryer.Execute(Func`1 action, Action recover) +394
   Sitecore.Security.SitecoreMembershipProvider.ValidateUser(String username, String password) +319
   System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e) +105
   System.Web.UI.WebControls.Login.AttemptLogin() +160
   System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +93
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +84
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3804

person Newbie    schedule 16.09.2014    source источник
comment
Какая версия Sitecore и какая версия модуля AD? Можете ли вы опубликовать свой ldap.config и конфигурацию, которую вы имеете для своих поставщиков членства и ролиManager? Похоже, что строка подключения LDAP имеет неправильный формат. Если пользователь-администратор может войти в систему, вероятно, проблема заключается в диспетчере ролей, поскольку имело бы смысл, что роль пользователя-администратора Sitecore не может быть проверена.   -  person Matt Gartman    schedule 16.09.2014
comment
@MattGartman спасибо за ответ .. версия sitecore 7.0, а модуль AD 1.1   -  person Newbie    schedule 16.09.2014
comment
С точки зрения устранения неполадок я бы попытался удалить параметры customFilter и посмотреть, сталкиваетесь ли вы с той же проблемой. Можете ли вы видеть пользователей и роли для домена в пользовательском интерфейсе Sitecore, когда вы вошли в систему как администратор Sitecore?   -  person Matt Gartman    schedule 17.09.2014
comment
@MattGartman да, я вижу пользователей и роли. Иногда я могу войти в систему, а иногда нет .. это так случайно .. не знаю, почему это так ..   -  person Newbie    schedule 18.09.2014
comment
Если это случайно, и конкретный пользователь иногда может войти в систему, но иногда получает эту ошибку, похоже, что это может быть связано с инфраструктурой. Я бы сначала начал с просмотра того, какие контроллеры домена вы используете, возможно, в вашем лесу AD есть более старый контроллер домена, которому не нравится запрос. Если вы можете попытаться указать строку подключения LDAP к одному контроллеру домена, чтобы попытаться исключить это. Кроме того, я бы начал смотреть в сеть, чтобы увидеть, происходит ли что-то там.   -  person Matt Gartman    schedule 18.09.2014


Ответы (4)


Я столкнулся с подобной проблемой для одного из моих веб-приложений. Если вы все еще сталкиваетесь с этой проблемой, вы можете исправить это, перейдя в Дополнительные настройки пула приложений IIS вашего приложения и установив для параметра «Загрузить профиль пользователя» значение True.

person Nirmal Thakur    schedule 06.01.2016
comment
Ваш ответ устранил проблему. Странно, мы могли бы перезапустить сервер, и он работал бы в течение нескольких часов. На этот раз, когда он снова начал выдавать эту ошибку, все, что я сделал, это попробовал ваше предложение, и оно исправило его. Любые идеи, почему он будет работать некоторое время без этого параметра, установленного в true, прежде чем взорваться? - person Hoodlum; 11.10.2016
comment
Спасибо, это исправлено. - person Chirag K; 27.10.2016
comment
Кроме того, знаете ли вы, что вызвало ошибку, я внес изменение, но по какой причине возникла эта ошибка. - person Chirag K; 27.10.2016
comment
Можете ли вы объяснить, что делает эта опция и почему она устранила проблему? - person Robouste; 01.02.2018

@MattGartman вот поставщики членства и ролей

<membership defaultProvider="sitecore" hashAlgorithmType="SHA1">
      <providers>
        <clear />
        <add name="sitecore" type="Sitecore.Security.SitecoreMembershipProvider, Sitecore.Kernel" realProviderName="switcher" providerWildcard="%" raiseEvents="true" />
        <add name="sql" type="System.Web.Security.SqlMembershipProvider" connectionStringName="core" applicationName="sitecore" minRequiredPasswordLength="1" minRequiredNonalphanumericCharacters="0" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="256" />
        <add name="switcher" type="Sitecore.Security.SwitchingMembershipProvider, Sitecore.Kernel" applicationName="sitecore" mappings="switchingProviders/membership" />
    <add name="ad" type="LightLDAP.SitecoreADMembershipProvider" connectionStringName="ADConnString" applicationName="sitecore" minRequiredPasswordLength="1" minRequiredNonalphanumericCharacters="0" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" connectionUsername="domain\username" connectionPassword="pw" connectionProtection="Secure" attributeMapUsername="sAMAccountName" enableSearchMethods="true" customFilter="(memberOf=CN=RegionsComSitecore,OU=Groups,DC=c,DC=pk,DC=com)" />
      </providers>
    </membership>
    <roleManager defaultProvider="sitecore" enabled="true">
      <providers>
        <clear />
        <add name="sitecore" type="Sitecore.Security.SitecoreRoleProvider, Sitecore.Kernel" realProviderName="switcher" raiseEvents="true" />
        <add name="sql" type="System.Web.Security.SqlRoleProvider" connectionStringName="core" applicationName="sitecore" />
        <add name="switcher" type="Sitecore.Security.SwitchingRoleProvider, Sitecore.Kernel" applicationName="sitecore" mappings="switchingProviders/roleManager" />
    <add name="ad" type="LightLDAP.SitecoreADRoleProvider" connectionStringName="ADConnString" applicationName="sitecore" username=" domain\username" password="pw" attributeMapUsername="sAMAccountName" cacheSize="2MB" customFilter="(memberOf=CN=RegionsComSitecore,OU=Groups,DC=c,DC=pk,DC=com)" />
      </providers>
    </roleManager>

вот ldap.config

<pipelines>

  <initializeAdUserEntry>
    <!-- 
    Use the processor if all new user should have a predefiled value in a property.
    The PropertyName parameter defines the name of the property.
    The DefaultValue parameter defines the default value of the property.
    -->
    <!--
    <processor type="LightLDAP.Pipelines.InitializeAdEntry.SetPropertyValue, LightLDAP">
      <PropertyName desc="AD property name ">type the property name here</PropertyName>
      <DefaultValue desc="AD property name ">type the default property value here</DefaultValue>
    </processor>
    -->
    <!-- 
      Use the processor if all new roles should be a member of the predefined role. 
      The RoleName parameter defines the name of the main role. 
    -->
    <!--
    <processor type="LightLDAP.Pipelines.InitializeAdEntry.AddToRole, LightLDAP">
      <RoleName desc="AD group">type role name here</RoleName>
    </processor>
    -->
    <processor type="LightLDAP.Pipelines.InitializeAdEntry.CommitChanges, LightLDAP"/>        
  </initializeAdUserEntry>

  <initializeAdRoleEntry>
    <!-- 
    Use the processor if all new user should have a predefiled value in a property.
    The PropertyName parameter defines the name of the property.
    The DefaultValue parameter defines the default value of the property.
    -->
    <!--
    <processor type="LightLDAP.Pipelines.InitializeAdEntry.SetPropertyValue, LightLDAP">
      <PropertyName desc="AD property name ">type the property name here</PropertyName>
      <DefaultValue desc="AD property value ">type the default property value here</DefaultValue>
    </processor>
    -->
    <!-- 
      Use the processor if all new roles should be a member of the predefined role. 
      The RoleName parameter defines the name of the main role. 
    -->
    <!--
    <processor type="LightLDAP.Pipelines.InitializeAdEntry.AddToRole, LightLDAP">
      <RoleName desc="AD group">type role name here</RoleName>
    </processor>
    -->
    <processor type="LightLDAP.Pipelines.InitializeAdEntry.CommitChanges, LightLDAP"/>
  </initializeAdRoleEntry>

</pipelines>

<settings>
  <!-- Defines the logging level of the module. If true, dumps every action entry into the log. 
          Default is false
       -->
  <setting name="LDAP.Debug" value="true" />

  <!-- Defines if the configuration assumes indirect membership on common operations.
          This setting affects the membership verification during login and user access check.
          Default is false
     -->
  <setting name="LDAP.IncludeIndirectMembership" value="false" />

  <!-- Defines if a certain profile should be applied for each user by default.
          If the setting is not specified or is empty, no particular profile item is used.
          Default is ""
     -->

  <!-- ENABLE SORT OPERATION
         Determines whether the sorting is enabled 
    -->
  <setting name="LDAP.EnableSorting" value="false" />

  <!-- Default Sort Key-->
  <setting name="LDAP.SortKey" value="codePage" />

  <!-- LDAP GET ALL USERS SIZE LIMIT
         Determines the max number of returned users for GetAll method
    -->
  <setting name="LDAP.SizeLimit" value="1000" />

  <!-- LDAP FIND USERS SIZE LIMIT
         Determines the max number of returned users for GetAll method
    -->
  <setting name="LDAP.FindSizeLimit" value="100" />


  <!-- LDAP USER CACHE SIZE
         Determines the size of the ldap users cache.
         Specify the value in bytes or append the value with KB, MB or GB
         A value of 0 (zero) disables the cache.
    -->
  <setting name="LDAP.Caching.UserCache" value="2MB" />

  <!-- LDAP MEMBEROF CACHE SIZE
         Determines the size of the ldap users cache.
         Specify the value in bytes or append the value with KB, MB or GB
         A value of 0 (zero) disables the cache.
    -->
  <setting name="LDAP.Caching.MemberOfCache" value="2MB" />

  <!-- LDAP MEMBERS CACHE SIZE
         Determines the size of the ldap users cache.
         Specify the value in bytes or append the value with KB, MB or GB
         A value of 0 (zero) disables the cache.
    -->
  <setting name="LDAP.Caching.MembersCache" value="2MB" />

  <!--  SETTINGS PROPERTY VALUE FACTORY
        Returns an SettingsPropertyValueFactory interface that resolves the active directory properties.
    -->
  <setting name="LDAP.SettingsPropertyValueFactory" value="LightLDAP.SettingsPropertyValueFactory, LightLDAP" />

  <!-- RECONNECT PERIOD
         Determines a reconnect period for attempts to restore connection after the connection gets break.
    -->
  <setting name="LDAP.ReconnectPeriod" value="0.00:00:10" />

  <!-- TIME OUT NOTIFICATION
         Determines a timeout for notification.
    -->
  <setting name="LDAP.NotificationTimeOut" value="1.00:00:00" />

  <!-- FULL NAME PROPERTY NAME
         Determines the full name property mapping.
    -->
  <setting name="LDAP.FullName" value="ad|unicode string|displayName" />

  <!-- DELETE USER SCOPE
         Determines the scope of the "delete user" operation.
    -->
  <setting name="LDAP.DeleteScope" value="Subtree" />

  <!-- MAX VALUE RANGE
         Determines the maximal value of an AD range attribute.
    -->
  <setting name="LDAP.MaxValueRange" value="1500" />

</settings>

person Newbie    schedule 16.09.2014

Для входа с поддержкой AD попробуйте войти со страницы /sitecore/admin/ldaplogin.aspx.

person xoail    schedule 16.09.2014

Я знаю, что этот вопрос старый, но недавно у меня возникла эта проблема, и я потратил немало времени на изучение причины и решения с помощью документов Microsoft и т. д. Иногда возникает проблема, вызванная процессом обновления IIS при попытке доступа к определенным интерфейсам. внутри com-объектов, которые динамически загружаются из различных DLL, написанных на C++. Такие DLL/интерфейсы могут быть сложными и запутанными. Я обнаружил, что лучшим решением будет избегать некоторых вызовов основных объектов группы пользователей, предоставляемых этим интерфейсом. Если вы вызываете метод, который выглядит примерно так: [Some user object].IsMemberOf([Some group object]). Попробуйте изменить код, чтобы избежать вызова какой-либо функции для пользовательского объекта. Из приведенного выше примера вы можете изменить код, чтобы он выглядел следующим образом:

foreach (var user in [Some group object].GetUsers())
{
    if (user.SamAccountName == [Some user object].SamAccountName)
    {
        // Do your work here
    }
}

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

person Kevin K.    schedule 21.05.2018