I have a web-app with an AngularJS front-end and a Web Api 2 back-end, and it uses bearer-tokens for authentication.
All is well in FireFox & IE, but with Chrome
I hope this is able to help somebody out there. For me:
app.useCors(); LOC did not work.app.useCors(); LOC worked for other people on my team.So I needed a solution that would work across everyone's environments.
Ultimately what I ended up doing was adding the header and value right into the Web.config with the following (where localhost:9000 is my node application that is serving up angular):
Then in production you can just change the origin value to the production front-end url.
If you want CORS enabled for all origins, change the value to "*".