Starts in:
1 DAY
1 HR
15 MIN
3 SEC
Starts in:
1 D
1 H
15 M
3 S
Open Closed

The required antiforgery cookie ".AspNetCore.Antiforgery.****" is not present. #2065


User avatar
0
Neozzz created

I have added a microservice service to a microservice solution. I followed the directions given in this doc: https://docs.abp.io/en/commercial/latest/startup-templates/microservice/add-microservice#running-the-solution

Then followed this doc: https://docs.abp.io/en/commercial/latest/startup-templates/microservice/synchronous-interservice-communication#updating-orderservice-application-contracts

Then did a migration and ran the project using:

tye run --watch

I am able to access the newly added end-point in swagger. But when I post data I get the error mentioned in the title.

The following is the trace.

Request starting HTTP/2 POST https://localhost:44337/api/app/product-type application/json 1122
2021-11-01 13:02:21.649 +04:00 [INF] Executing endpoint 'ZW.ProductSvc.ProductTypes.ProductTypeController.CreateAsync (ZW.ProductSvc.HttpApi)'
2021-11-01 13:02:21.660 +04:00 [INF] Route matched with {action = "Create", controller = "ProductType", area = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[System.Guid] CreateAsync(ZW.ProductSvc.ProductTypes.ProductTypeCreateDto) on controller ZW.ProductSvc.ProductTypes.ProductTypeController (ZW.ProductSvc.HttpApi).
2021-11-01 13:02:21.662 +04:00 [ERR] The required antiforgery cookie ".AspNetCore.Antiforgery.Schh12Bn9tQ" is not present.
2021-11-01 13:02:21.662 +04:00 [INF] Authorization failed for the request at filter 'Volo.Abp.AspNetCore.Mvc.AntiForgery.AbpAutoValidateAntiforgeryTokenAuthorizationFilter'.
2021-11-01 13:02:21.665 +04:00 [INF] Executing HttpStatusCodeResult, setting HTTP status code 400
2021-11-01 13:02:21.665 +04:00 [INF] Executed action ZW.ProductSvc.ProductTypes.ProductTypeController.CreateAsync (ZW.ProductSvc.HttpApi) in 5.2878ms
2021-11-01 13:02:21.665 +04:00 [INF] Executed endpoint 'ZW.ProductSvc.ProductTypes.ProductTypeController.CreateAsync (ZW.ProductSvc.HttpApi)'
2021-11-01 13:02:22.658 +04:00 [DBG] Added 0 entity changes to the current audit log
2021-11-01 13:02:22.658 +04:00 [DBG] Added 0 entity changes to the current audit log
2021-11-01 13:02:22.663 +04:00 [INF] Request finished HTTP/2 POST https://localhost:44337/api/app/product-type application/json 1122 - 400 0 - 1016.7524ms

Please let me know what might be causing this issue.

Thank you


No answer yet!
Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06