I am having a 401 error code when I access to the api using Jquery Ajax. This is my front-end code: For my back-end, I am using ASP.NET Identity and my startup.cs code is I have tested. Without [Authorize] attribute, I can see the result response at the client side. But once I have added [Authorize] attribute and added headers