Base solution for your next web application
Open Closed

Login fails #7079


User avatar
0
konverto created

Good morning,

I'm currently setting up my project, following these instructions: https://docs.aspnetzero.com/documents/aspnet-core-angular/latest/Getting-Started-Angular-Merged

I've created the db, run the project and went to the login mask. As Tenant name I use "Default", with the default admin user login data, provided in the code / demo db.

But as I try to login I'm getting an error:

  • xPortalMergedDemo.Web.Controllers.UiController.GetLoginResultAsync(string usernameOrEmailAddress, string password, string tenancyName) in UiController.cs throw _abpLoginResultTypeHelper.CreateExceptionForFailedLoginAttempt(loginResult.Result, usernameOrEmailAddress, tenancyName);

  • xPortalMergedDemo.Web.Controllers.UiController.Login(LoginModel model) in UiController.cs var loginResult = await GetLoginResultAsync(model.UserNameOrEmailAddress, model.Password, model.TenancyName); Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor+TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, object controller, object[] arguments)

What am I missing here? Any hint is appreciated!!!

Thanks very much in advance, Kind regards Vicky Pallaoro


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

    Can you share the complete error log?

  • User Avatar
    0
    konverto created

    Sure!! This is the complete log:


    An unhandled exception occurred while processing the request. UserFriendlyException: Login failed! RvsPortalMergedDemo.Web.Controllers.UiController.GetLoginResultAsync(string usernameOrEmailAddress, string password, string tenancyName) in UiController.cs, line 119


    Abp.UI.UserFriendlyException: Login failed! at RvsPortalMergedDemo.Web.Controllers.UiController.GetLoginResultAsync(String usernameOrEmailAddress, String password, String tenancyName) in C:\Users\upalv\projects\aspnetzero\demo\RvsPortalMergedDemo\RvsPortalMergedDemo\src\RvsPortalMergedDemo.Web.Host\Controllers\UiController.cs:line 119 at RvsPortalMergedDemo.Web.Controllers.UiController.Login(LoginModel model) in C:\Users\upalv\projects\aspnetzero\demo\RvsPortalMergedDemo\RvsPortalMergedDemo\src\RvsPortalMergedDemo.Web.Host\Controllers\UiController.cs:line 86 at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.TaskOfIActionResultExecutor.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() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ExceptionContext context) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync() at Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context) at RvsPortalMergedDemo.Web.Startup.Startup.<>c.<<Configure>b__5_1>d.MoveNext() in C:\Users\upalv\projects\aspnetzero\demo\RvsPortalMergedDemo\RvsPortalMergedDemo\src\RvsPortalMergedDemo.Web.Host\Startup\Startup.cs:line 173 --- End of stack trace from previous location where exception was thrown --- at Abp.AspNetZeroCore.Web.Authentication.JwtBearer.JwtTokenMiddleware.<>c__DisplayClass0_0.<<UseJwtTokenMiddleware>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.InvokeCore(HttpContext context) at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

  • User Avatar
    0
    maliming created
    Support Team

    The function of UiController is very simple. You can set the breakpoint here to see the value of loginResult.Result

    https://github.com/aspnetzero/aspnet-zero-core/blob/f594ff64edda3a0aa0577bab3663948021e5292e/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Host/Controllers/UiController.cs#L114

  • User Avatar
    0
    konverto created

    with the breakpoint i've been able to fugure out the problem. Thank you very much for your help!