Hi there,
I am trying to import users from excel, but I am getting the below error: I am using ASPNetZero Version 8.0 with Angular.
POST http://localhost:22742/Users/ImportFromExcel 401 (Unauthorized)
Please assist...
Regards, Mahendra
7 Answer(s)
-
0
Maybe related this issue: https://github.com/aspnetzero/aspnet-zero-core/pull/2799
Can you check it?
-
0
I always gets the 404 on the above URL. I am already signed with cxs-mahendra
-
0
-
0
Hi,
I am using ASPNetZero 8.0 with angular. I created a duplicate of
Web.Host\Controllers\UsersController.cs and Web.Core\Controllers\UsersControllerBase.cs
and created the following
Web.Host\Controllers\ImportExportController.cs and Web.Core\Controllers\ImportExportControllerBase.cs
The issue, I am facing is: If I have following attribute on an action in the Web.Host\Controllers\ImportExportController.cs [AbpMvcAuthorize(AppPermissions.Pages_Administration_Users_Create)]
My action never gets called and get the following error in Chrome developer console. GET http://localhost:22742/Account/Login?ReturnUrl=%2FImportExport%2FImportFromExcel 404 (Not Found) ERROR HttpErrorResponse {headers: HttpHeaders, status: 404, statusText: "Not Found", url: "http://localhost:22742/Account/Login?ReturnUrl=%2FImportExport%2FImportFromExcel", ok: false, …}
But if I don't have the above attribute then the action gets called. But in this case I always get AbpSession.UserId as null.
Please help
Regards, Mahendra
-
0
I had changed the startup as you suggested in your last email...
............... ............... app.UseAuthentication(); //app.UseAuthorization(); app.UseJwtTokenMiddleware(); if (bool.Parse(_appConfiguration["IdentityServer:IsEnabled"])) { //app.UseJwtTokenMiddleware("IdentityBearer"); app.UseIdentityServer(); } app.UseAuthorization(); ............... ...............
-
0
hi
Can you check the application logs?
-
0
Hi,
This has been fixed... I saw one of your support ticket having same problem (the bearer token was not getting passed in the request) So I added the HttpInterceptor in our module and it started getting called.
Regards, Mahendra