Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Active Directory Integration: System.NullReferenceException #9728


User avatar
0
lweng567 created

Prerequisites

Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • What is your product version? V9.2.0
  • What is your product type (Angular or MVC)? Angular
  • What is product framework type (.net framework or .net core)? .Net Core

I followed the documentation to enable Active Directory integration,

  1. Configuration.Modules.ZeroLdap().Enable(typeof(AppLdapAuthenticationSource));
  2. in the user setting, update Ldap setting accordingly.

when i tried to log in using my AD account, i got a System.NullReferenceException in the GetLoginResultAsync in TokenAuthController. Can you please advise if there is anything else i need to set up

thanks Laurie


4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @lweng567

    Could you share the full error stack trace ? You can find it in App_Data/Logs/Logs.txt file under your Host project.

  • User Avatar
    0
    lweng567 created

    INFO 2020-10-14 16:12:19,442 [37 ] c.Infrastructure.ControllerActionInvoker - Route matched with {action = "Authenticate", controller = "TokenAuth", area = ""}. Executing controller action with signature System.Threading.Tasks.Task1[FinesseNx.Web.Models.TokenAuth.AuthenticateResultModel] Authenticate(FinesseNx.Web.Models.TokenAuth.AuthenticateModel) on controller FinesseNx.Web.Controllers.TokenAuthController (FinesseNx.Web.Core). ERROR 2020-10-14 16:12:26,090 [4 ] Mvc.ExceptionHandling.AbpExceptionFilter - Object reference not set to an instance of an object. System.NullReferenceException: Object reference not set to an instance of an object. at Abp.Authorization.Users.AbpUser1.SetNormalizedNames() at Abp.Authorization.AbpLogInManager3.TryLoginFromExternalAuthenticationSourcesAsync(String userNameOrEmailAddress, String plainPassword, TTenant tenant) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Abp.Authorization.AbpLogInManager3.LoginAsyncInternal(String userNameOrEmailAddress, String plainPassword, String tenancyName, Boolean shouldLockout) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Abp.Authorization.AbpLogInManager3.LoginAsync(String userNameOrEmailAddress, String plainPassword, String tenancyName, Boolean shouldLockout) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at FinesseNx.Web.Controllers.TokenAuthController.GetLoginResultAsync(String usernameOrEmailAddress, String password, String tenancyName) in C:\Web Dev\FinesseNx-Main\aspnet-core\src\FinesseNx.Web.Core\Controllers\TokenAuthController.cs:line 649 at FinesseNx.Web.Controllers.TokenAuthController.Authenticate(AuthenticateModel model) in C:\Web Dev\FinesseNx-Main\aspnet-core\src\FinesseNx.Web.Core\Controllers\TokenAuthController.cs:line 138 at lambda_method(Closure , Object ) at Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult() at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.In

  • User Avatar
    0
    lweng567 created

    I think I know why, because AD integration requires user to have an email address. After I assigned an email address to the AD user, i can log in and created an user in my Zero app now.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @lweng567

    Thanks :)