Thanks SDP1966 but, after installing that plugin I’m still getting the error, I´m sure that is because I´m doing something wrong…
I have added the following lines to config.xml:
Response:
XMLHttpRequest cannot load http://xxx/token. Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://192.168.1.79:8100’ is therefore not allowed access. The response had HTTP status code 400.
I don´t really know if the request arrived at the server… I think not.
I don´t know if this info helps but I´m using a WebApi2 data service over an Azure website for the backend and I’m using ‘ionic serve’ to debug from local machine.
First of all, I want to thank all you for the help, second I finally managed to make it work but using the Azure Portal (there´s a section for CORS management that I did not know:
I´ve taken that image just in case someone gets to the same ‘trouble’.
Doing what SDP1966 posted about inserting the <allow-navigation… > to index.html was returning the error: The Content Security Policy ‘default-src ‘self’ http:’ was delivered via a element outside the document’s , which is disallowed. The policy has been ignored. I did then double check I had inserted that in the head section… and I did so I don´t know why it´s getting this error…
Doing what Kuntal posted didn´t seem to work either (didn´t debug so I´m not sure).
It seems that my issue was with Azure after all… and I´m not too sure how CORS works on Azure so another thing I will have to investigate
Cors error can only be resolved from server side.
But yes for browser only we can resolved it by installing cors extension but for device can be only from server side