I’m working on an ASP.NET Core Web API project where I’m encountering an issue with the Authorization header. When I use the “Authorize” button in Swagger, the authorization works as expected, and the API receives the header correctly.
However, when I try to call the same endpoint directly using swagger, the Authorization header seems to be missing, and the API does not receive it.
I tried to call the authentication endpoint directly it seems the 400 request.
I expected that when I call the endpoint directly with the Authorization header set, the API would receive the header and authenticate the request, just as it does when called via Swagger.
GOKUL S P is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.