when i added 'Configuration.Modules.ZeroLdap().Enable(typeof(AppLdapSettings));' in PreInitialize method. i got new error message.
could you please give me sample code?
System.InvalidCastException: Unable to cast object of type 'XunyisoftSmartApp.Authorization.Ldap.AppLdapSettings' to type 'Abp.Authorization.Users.IExternalAuthenticationSource2[XunyisoftSmartApp.MultiTenancy.Tenant,XunyisoftSmartApp.Authorization.Users.User]'. at Abp.Dependency.IocResolverExtensions.ResolveAsDisposable[T](IIocResolver iocResolver, Type type) in D:\Github\aspnetboilerplate\src\Abp\Dependency\IocResolverExtensions.cs:line 30 at Abp.Authorization.AbpLogInManager
3.TryLoginFromExternalAuthenticationSources(String userNameOrEmailAddress, String plainPassword, TTenant tenant) in D:\Github\aspnetboilerplate\src\Abp.ZeroCore\Authorization\AbpLoginManager.cs:line 289
at Abp.Authorization.AbpLogInManager3.LoginAsyncInternal(String userNameOrEmailAddress, String plainPassword, String tenancyName, Boolean shouldLockout) in D:\Github\aspnetboilerplate\src\Abp.ZeroCore\Authorization\AbpLoginManager.cs:line 170 at Abp.Authorization.AbpLogInManager
3.LoginAsync(String userNameOrEmailAddress, String plainPassword, String tenancyName, Boolean shouldLockout)
at Abp.Threading.InternalAsyncHelper.AwaitTaskWithPostActionAndFinallyAndGetResult[T](Task1 actualReturnValue, Func
1 postAction, Action1 finalAction) at XunyisoftSmartApp.Web.Controllers.AccountController.GetLoginResultAsync(String usernameOrEmailAddress, String password, String tenancyName) in C:\Users\Me\Documents\Projects\XunyisoftSmartApp722\src\XunyisoftSmartApp.Web.Mvc\Controllers\AccountController.cs:line 249 at XunyisoftSmartApp.Web.Controllers.AccountController.Login(LoginViewModel loginModel, String returnUrl, String returnUrlHash, String ss) in C:\Users\Me\Documents\Projects\XunyisoftSmartApp722\src\XunyisoftSmartApp.Web.Mvc\Controllers\AccountController.cs:line 174 at Abp.Threading.InternalAsyncHelper.AwaitTaskWithPostActionAndFinallyAndGetResult[T](Task
1 actualReturnValue, Func1 postAction, Action
1 finalAction)
at lambda_method(Closure , Object )
at ...
System.DirectoryServices.DirectoryServicesCOMException (0x8007052E): user name or password not right。
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.PropertyValueCollection.PopulateList()
at System.DirectoryServices.PropertyValueCollection..ctor(DirectoryEntry entry, String propertyName)
at System.DirectoryServices.PropertyCollection.get_Item(String propertyName)
at System.DirectoryServices.AccountManagement.PrincipalContext.DoLDAPDirectoryInitNoContainer()
at System.DirectoryServices.AccountManagement.PrincipalContext.Initialize()
at System.DirectoryServices.AccountManagement.Principal.FindByIdentityWithTypeHelper(PrincipalContext context, Type principalType, Nullable1 identityType, String identityValue, DateTime refDate) at System.DirectoryServices.AccountManagement.Principal.FindByIdentityWithType(PrincipalContext context, Type principalType, String identityValue) at System.DirectoryServices.AccountManagement.UserPrincipal.FindByIdentity(PrincipalContext context, String identityValue) at Abp.Zero.Ldap.Authentication.LdapAuthenticationSource
2.UpdateUserAsync(TUser user, TTenant tenant)
at Abp.Authorization.AbpLogInManager3.TryLoginFromExternalAuthenticationSources(String userNameOrEmailAddress, String plainPassword, TTenant tenant) at Abp.Authorization.AbpLogInManager
3.LoginAsyncInternal(String userNameOrEmailAddress, String plainPassword, String tenancyName, Boolean shouldLockout)
at Abp.Authorization.AbpLogInManager3.LoginAsync(String userNameOrEmailAddress, String plainPassword, String tenancyName, Boolean shouldLockout) at Abp.Threading.InternalAsyncHelper.AwaitTaskWithPostActionAndFinallyAndGetResult[T](Task
1 actualReturnValue, Func1 postAction, Action
1 finalAction)
at XunyisoftSmartApp.Web.Controllers.AccountController.GetLoginResultAsync(String usernameOrEmailAddress, String password, String tenancyName) in C:\Users\Me\Documents\Projects\XunyisoftSmartApp722...
System.DirectoryServices.DirectoryServicesCOMException (0x8007052E): user name or password not right。
login.js chaged to bellow
ref:https://github.com/aspnetzero/aspnet-zero-core/pull/2670
abp.ui.setBusy(
null,
abp.ajax({
contentType: app.consts.contentTypes.formUrlencoded,
url: $loginForm.attr('action'),
data: $loginForm.serialize()
}).fail(function () {
var isUseCaptcha = abp.setting.getBoolean("App.UserManagement.UseCaptchaOnLogin");
if (isUseCaptcha) {
grecaptcha.reset();
}
//grecaptcha.reset();
})
);