Note that there are some explanatory texts on larger screens.

plurals
  1. POHTTP GET to amazon aws from jquery or XMLHttpRequest fails with Origin is not allowed by Access-Control-Allow-Origin
    primarykey
    data
    text
    <p>Having some bad luck with getting amazon AWS security token from jQuery or XMLHttpRequest. When I send a HTTP GET from jQuery or XmlHttpRequest, I get "Origin http:// MY_IP is not allowed by Access-Control-Allow-Origin.", but if I paste the same URL in my browser, it all goes fine.</p> <p>My code:</p> <pre><code>var url_ = "https://sts.amazonaws.com/?Action=GetSessionToken" + "&amp;DurationSeconds=3600" + "&amp;AWSAccessKeyId=" + AccessKeyId + "&amp;Version=2011-06-15" + "&amp;Timestamp=" + encode(timestamp) + "&amp;Signature=" + encode(hash) + "&amp;SignatureVersion=2&amp;SignatureMethod=HmacSHA256"; $.get(url_, function(data) { alert("response: "+data); }); </code></pre> <p><strong>My Headers:</strong></p> <p>Response Headers<br/> Accept-Ranges bytes<br/> Age 198<br/> Connection Keep-Alive<br/> Content-Length 3739<br/> Content-Type text/html<br/> Date Mon, 25 Jun 2012 17:48:20 GMT<br/> Etag "48c4862-e9b-4c34f76b13400"<br/> Last-Modified Mon, 25 Jun 2012 17:39:28 GMT<br/> Proxy-Connection Keep-Alive<br/> Server Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8r DAV/2 PHP/5.3.10 with Suhosin-Patch<br/><br/></p> <p>Request Headers<br/> Accept text/html,application/xhtml+xml,application/xml;q=0.9,<em>/</em>;q=0.8<br/> Accept-Encoding gzip, deflate<br/> Accept-Language en-us,en;q=0.5<br/> DNT 1<br/> Host <strong>MY_IP</strong><br/> If-Modified-Since Mon, 25 Jun 2012 17:13:16 GMT<br/> If-None-Match "48c127c-ea2-4c34f18fe6300"<br/> Proxy-Connection keep-alive<br/> User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0) Gecko/20100101 Firefox/12.0<br/><br/></p> <p><strong>Browser headers (if used URL in browser)</strong><br/></p> <p>Response Headers<br/> Content-Length 808<br/> Content-Type text/xml<br/> Date Mon, 25 Jun 2012 17:31:54 GMT<br/> x-amzn-RequestId a854ff13-beeb-11e1-b3ac-0147da731d96<br/><br/></p> <p>Request Headers<br/> Accept text/html,application/xhtml+xml,application/xml;q=0.9,<em>/</em>;q=0.8<br/> Accept-Encoding gzip, deflate<br/> Accept-Language en-us,en;q=0.5<br/> Connection keep-alive<br/> DNT 1<br/> Host <strong>sts.amazonaws.com</strong><br/> User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0) Gecko/20100101 Firefox/12.0<br/><br/></p> <p>I tried some code from <a href="http://www.html5rocks.com/en/tutorials/cors/" rel="nofollow">http://www.html5rocks.com/en/tutorials/cors/</a> , but no luck</p> <p>Any help is appreciated</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload