I have deployed my service using the provided Helm charts. But once testing it in Swagger (the authentication seems be ok) I got the following error from server.
[20:24:45 INF] Request starting HTTP/1.1 POST http://myproject-ticket/api/ticket/tickets - application/json 333
[20:24:45 INF] CORS policy execution successful.
[20:24:45 INF] Executing endpoint 'myproject.TicketService.Tickets.TicketsAppService.CreateAsync (myproject.TicketService)'
[20:24:45 INF] Route matched with {action = "Create", controller = "Tickets", area = "", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[myproject.TicketService.Tickets.TicketDto] CreateAsync(myproject.TicketService.Tickets.TicketCreateDto) on controller myproject.TicketService.Tickets.TicketsAppService (myproject.TicketService).
[20:24:45 WRN] The required antiforgery cookie ".AspNetCore.Antiforgery.Pqki2eFce9s" is not present.
[20:24:45 INF] Authorization failed for the request at filter 'Volo.Abp.AspNetCore.Mvc.AntiForgery.AbpAutoValidateAntiforgeryTokenAuthorizationFilter'.
[20:24:45 INF] Executing StatusCodeResult, setting HTTP status code 400
[20:24:45 INF] Executed action myproject.TicketService.Tickets.TicketsAppService.CreateAsync (myproject.TicketService) in 1.4636ms
[20:24:45 INF] Executed endpoint 'myproject.TicketService.Tickets.TicketsAppService.CreateAsync (myproject.TicketService)'
[20:24:45 INF] Request finished HTTP/1.1 POST http://myproject-ticket/api/ticket/tickets - 400 0 null 28.3141ms
Do you have any idea what the problem is?
Thanks
5 Answer(s)
-
0
hi
Can you try to use
HTTPS
instead ofHTTP
? Otherwise, you need to handle the Cookies. https://learn.microsoft.com/en-us/aspnet/core/security/samesite?view=aspnetcore-9.0#api-usage-with-samesite https://learn.microsoft.com/en-us/aspnet/core/security/samesite?view=aspnetcore-9.0#supporting-older-browsersThanks.
-
0
For some reason it seems to only be related to Safari web browser, and not Chrome. Any ideas why?
Thanks
-
0
hi
This is the difference in cookie policies between Safari and Chrome browsers.
You can check this article https://abp.io/community/articles/patch-for-chrome-login-issue-identityserver4-samesite-cookie-problem-weypwp3n
-
0
Thanks, I will take a look :-)
-
0
; )