Login attempt leads to application crash when Sitecore Active Directory module is used


Description

In Sitecore XP solutions with the Active Directory 1.3 module installed, users might experience the application crash after a login attempt with the following exceptions:

Exception 1:

Exception: System.ArgumentException
Message: The provider user key supplied is invalid. It must be of type System.Guid. Parameter name: providerUserKey Source: System.Web    at System.Web.Security.SqlMembershipProvider.GetUser(Object providerUserKey, Boolean userIsOnline)    at Sitecore.Security.SwitchingMembershipProvider.GetUser(Object providerUserKey, Boolean userIsOnline)    at Sitecore.Data.DataProviders.NullRetryer.Execute[T](Func`1 action, Action recover)    at Sitecore.Security.SitecoreMembershipProvider.GetUser(Object providerUserKey, Boolean userIsOnline)    at Sitecore.Security.Authentication.AuthenticationHelper.ParseUserName(String userName)    at Sitecore.Security.Authentication.DefaultAuthenticationManager.GetUserName(String rawUserName)    at Sitecore.Security.Authentication.DefaultAuthenticationManager.Login(String userName, String password, Boolean persistent)    at Sitecore.sitecore.login.Default.Login()    at Sitecore.sitecore.login.Default.LoginClicked(Object sender, EventArgs e)    at System.Web.UI.WebControls.Button.OnClick(EventArgs e)    at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)    at System.Web.UI.Page.<ProcessRequestMainAsync>d__523.MoveNext()

Exception 2:

Exception: System.ArgumentException
Message: The provider user key supplied is invalid. It must be of type System.Security.Principal.SecurityIdentifier.
Parameter name: providerUserKey
Source: System.Web
   at System.Web.Security.ActiveDirectoryMembershipProvider.GetUser(Object providerUserKey, Boolean userIsOnline)
   at LightLDAP.SitecoreADMembershipProvider.GetUser(Object providerUserKey, Boolean userIsOnline)
   at Sitecore.Security.SwitchingMembershipProvider.GetUser(Object providerUserKey, Boolean userIsOnline)
   at Sitecore.Data.DataProviders.NullRetryer.Execute[T](Func`1 action, Action recover)
   at Sitecore.Security.SitecoreMembershipProvider.GetUser(Object providerUserKey, Boolean userIsOnline)
   at Sitecore.Security.Authentication.AuthenticationHelper.ParseUserName(String userName)
   at Sitecore.Security.Authentication.DefaultAuthenticationManager.GetUserName(String rawUserName)
   at Sitecore.Security.Authentication.DefaultAuthenticationManager.Login(String userName, String password, Boolean persistent)
   at Sitecore.Admin.Login.DoLogin(String username, String password)
   at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
   at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Solution

To resolve the issue, download and install the patch compatible with the affected product version found on this page:

https://github.com/SitecoreSupport/Sitecore.Support.139945/releases