Login using the correct username and password with the LDAP return Internal Server Error. Below is the log file however couldnt find any solution on it.
INFO 2023-09-15 09:21:58,299 [112 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method XXX.Web.Controllers.TokenAuthController.Authenticate (XXX.Web.Core) with arguments (XXX.Web.Models.TokenAuth.AuthenticateModel) - Validation state: Valid
ERROR 2023-09-15 09:21:58,317 [112 ] Mvc.ExceptionHandling.AbpExceptionFilter - The user name and password must either both be null or both must be non-null.
System.ArgumentException: The user name and password must either both be null or both must be non-null.
at System.DirectoryServices.AccountManagement.PrincipalContext..ctor(ContextType contextType, String name, String container, ContextOptions options, String userName, String password)
at Abp.Zero.Ldap.Authentication.LdapAuthenticationSource2.CreatePrincipalContext(TTenant tenant) at Abp.Zero.Ldap.Authentication.LdapAuthenticationSource
2.TryAuthenticateAsync(String userNameOrEmailAddress, String plainPassword, TTenant tenant)
at Abp.Authorization.AbpLogInManager3.LoginAsyncInternal(String userNameOrEmailAddress, String plainPassword, String tenancyName, Boolean shouldLockout) 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, Action`1 finalAction)
at XXX.Web.Controllers.TokenAuthController.GetLoginResultAsync(String usernameOrEmailAddress, String password, String tenancyName)
at XXX.Web.Controllers.TokenAuthController.Authenticate(AuthenticateModel model)
at lambda_method(Closure , Object )
at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextExceptionFilterAsync()
1 Answer(s)
-
0
Hi,
Could you debug your code and see the values send to
TokenAuthController.Authenticate
method ?Thanks,