abpframework / abp

Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
https://abp.io
GNU Lesser General Public License v3.0
12.94k stars 3.45k forks source link

Abp Upgrade Issue #18369

Open yusufokaraman opened 11 months ago

yusufokaraman commented 11 months ago

I haven't been working on a blog or anywhere else for a few days. I have a project written in Abp Framework 3.1.2 and I have updated this project to the latest version of 7.4.2. I upgraded the .Net version from 3.1 to .Net 7. There were mistakes in many places because nothing had been done for a long time, but I edited them all. Finally, when I started the project, I saw that while the MVC UIs were working properly, I got an error when requesting in the /api endpoints of these MVC UIs. The error I got is a 400 Bad Request error. I couldn't fix it in any way. When I made a request to the /api endpoint via the incognito tab, I observed that it worked fine. I thought my problem was related to local cookies, but I couldn't find any results. What can I do to make it work properly in my locale?

I also share with you the error example I got while working in the local.

2023-12-05 03:28:26.679 +03:00 [INF] Request finished HTTP/2 GET https://localhost:44318/api/app/about/about - - - 204 - - 82.2401ms 2023-12-05 03:28:49.057 +03:00 [INF] Request starting HTTP/2 POST https://localhost:44318/api/account/register application/json-patch+json 111 2023-12-05 03:28:49.059 +03:00 [DBG] AuthenticationScheme: Bearer was not authenticated. 2023-12-05 03:28:49.062 +03:00 [INF] No CORS policy found for the specified request. 2023-12-05 03:28:49.063 +03:00 [INF] Executing endpoint 'Volo.Abp.Account.AccountController.RegisterAsync (Volo.Abp.Account.HttpApi)' 2023-12-05 03:28:49.066 +03:00 [INF] Route matched with {area = "account", action = "Register", controller = "Account", page = ""}. Executing controller action with signature System.Threading.Tasks.Task1[Volo.Abp.Identity.IdentityUserDto] RegisterAsync(Volo.Abp.Account.RegisterDto) on controller Volo.Abp.Account.AccountController (Volo.Abp.Account.HttpApi). 2023-12-05 03:28:49.070 +03:00 [WRN] The required antiforgery header value "RequestVerificationToken" is not present. 2023-12-05 03:28:49.071 +03:00 [INF] Authorization failed for the request at filter 'Volo.Abp.AspNetCore.Mvc.AntiForgery.AbpAutoValidateAntiforgeryTokenAuthorizationFilter'. 2023-12-05 03:28:49.074 +03:00 [INF] Executing StatusCodeResult, setting HTTP status code 400 2023-12-05 03:28:49.074 +03:00 [INF] Executed action Volo.Abp.Account.AccountController.RegisterAsync (Volo.Abp.Account.HttpApi) in 7.4692ms 2023-12-05 03:28:49.074 +03:00 [INF] Executed endpoint 'Volo.Abp.Account.AccountController.RegisterAsync (Volo.Abp.Account.HttpApi)' 2023-12-05 03:28:49.215 +03:00 [DBG] Added 0 entity changes to the current audit log 2023-12-05 03:28:49.216 +03:00 [DBG] Added 0 entity changes to the current audit log 2023-12-05 03:28:49.222 +03:00 [INF] Request finished HTTP/2 POST https://localhost:44318/api/account/register application/json-patch+json 111 - 400 - - 165.2739ms 2023-12-05 03:29:00.991 +03:00 [INF] Request starting HTTP/2 POST https://localhost:44318/api/account/register application/json 111 2023-12-05 03:29:00.995 +03:00 [DBG] AuthenticationScheme: Bearer was not authenticated. 2023-12-05 03:29:00.995 +03:00 [INF] No CORS policy found for the specified request. 2023-12-05 03:29:00.997 +03:00 [INF] Executing endpoint 'Volo.Abp.Account.AccountController.RegisterAsync (Volo.Abp.Account.HttpApi)' 2023-12-05 03:29:00.997 +03:00 [INF] Route matched with {area = "account", action = "Register", controller = "Account", page = ""}. Executing controller action with signature System.Threading.Tasks.Task1[Volo.Abp.Identity.IdentityUserDto] RegisterAsync(Volo.Abp.Account.RegisterDto) on controller Volo.Abp.Account.AccountController (Volo.Abp.Account.HttpApi).

realLiangshiwei commented 11 months ago

The required antiforgery header value "RequestVerificationToken" is not present

yusufokaraman commented 11 months ago

It doesn't give such an error when working on an incognito tab

realLiangshiwei commented 11 months ago

It doesn't give such an error when working on an incognito tab

That means that the application is working properly. You can try to clear the browser cookies or change the browser test.

I have no suggestions for this.

I noticed that your previous version is too old, and you need to carefully check the migration documents and template changes.

yusufokaraman commented 11 months ago

It continiues to work like this even though i have cleared browser cookies etc. In addition, I will check migrations documents. Probably, if i send to project, it will run normally. i will continue to research. Thanks for support.