Asp.net core web api with JWT throwing No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access
Hi I have implemented JWT in my asp.net core web api. When i try to call url/token from my jquery application, JWT middleware in api works fine as far as checking credentials and generating token. But when it reaches this point await context.Response.WriteAsync(JsonConvert.SerializeObject(response, new JsonSerializerSettings { Formatting = Formatting.Indented }));
it returns to my jquery app with error, No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
Is there anything i need to do specifically for this. One more thing that my other APIs are working properly apart from /token api.
@rynowak @blowdart
How did you start the app? Templates? Which version?
I have implemented JWT middleware in my ASP.NET Core Web API. Now from my JS application, i am calling url/token url with username and password . This is the process i have been following .
@blowdart - can you take another look?
OK, so you started with File New Project "ASP.NET Core Web Application", then you choose WebApi?
What's in your ConfigureServices?
Closing because there is not enough information to reproduce this problem.