1

I'm attempting to build a jQuery mobile application locally that connect to my website via XMLHttpRequest/XCRF/JSON. When attempting to connect to my website I get the following error:

XMLHttpRequest cannot load http://wwws.mydomain.com/rest/system/connect. 
A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true. 
Origin 'http://localhost' is therefore not allowed access.

I'm enabled CORS on my webserver (mydomain.com) per CORS documentation:

Header always set Access-Control-Allow-Origin "*"

How can I test my webservice from outside of my website? When this is converted to an Android app will I have similar problems?

Ken J
  • 4,312
  • 12
  • 50
  • 86

1 Answers1

0

This is a part of security, you cannot do that. If you want to allow credentials then your Access-Control-Allow-Origin must not use *.

Check out these thread: Cross Origin Resource Sharing with Credentials

Community
  • 1
  • 1
rrgirish
  • 331
  • 2
  • 3
  • 15
  • This is fine, I can set the domain manually but will this affect a Phonegap project and how it connects? – Ken J Apr 10 '15 at 09:49