- What is your product version = 9.0.1
- What is your product type = Angular
- What is product framework type = .net core
If issue related with ABP Framework
- What is ABP Framework version = 5.10.1
Hi , I am calling the API in swagger and it give me 400 (bad request) but when I have tried to execute the same API using POST man I am able to execute the API. So I investigate it furture and check the logs in azure app service , I got an expection when I am trying to do the post call from swagger.It gives me folling error : idateAntiforgeryTokenAuthorizationFilter - The provided antiforgery token was meant for a different claims-based user than the current user. Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The provided antiforgery token was meant for a different claims-based user than the current user.. It's strange as the same API is working correctly in Postman but not in swagger.
screen shot of postman using same api
Please provide a solution as soon as possible
Thanks
13 Answer(s)
-
0
Hi,
You can reply your swagger html and js files with the latest ones https://github.com/aspnetzero/aspnet-zero-core/tree/dev/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Host/wwwroot/swagger/ui.
Then, it should work.
-
0
-
0
Hi @shedspotter
Does this error happen when you visit the website in a incognito mode ?
Thanks,
-
0
Hi @ismcagdas , no in normal window we are facing this issue and also now when I am trying to access the API in post man it gives me unsuppoerted media type as error and also I have tried https://support.aspnetzero.com/QA/Questions/6969/Error-405-on-Swagger-with-update-and-delete-service#answer-22bcbe8f-c259-b28b-3e98-39eda8d8ab08 but is not working
-
0
Hi @shedspotter
Is it possible to share your project with us via email ?
-
0
Hi @ismcagdas , I will give you the credientials for accessing the application, please share your email
Thanks
-
0
-
0
I have send it the credientials [email protected]. with ticket
-
0
Hi @shedspotter
Thanks, got it and will check soon.
-
0
Hi @ismcagdas is there any update on the above issue
-
0
Hi **@shedspotter **
We are working on this but couldn't find a solution yet. I will inform you when we find a solution.
Thanks,
-
0
Hi ismcagdas, can I get an update on the issue it is almot 7 month. I am getting the same issue in another project where the get apI's work in swagger but post api is not wokring in swgger every time when I am trying to test the post api is gives me 400 but when same api I am calling from the web ir is working correctly but not in swagger . Can you please resolve that issue as soon as possible ? Thaks
-
0
Hi @shedspotter
We coudln't reproduce this problem somehow. Can you check your project to see if you have a similar issue with this one ? https://github.com/aspnetzero/aspnet-zero-core/issues/2881#issuecomment-570129852