same-origin-policy

Same-origin policy workaround using document.domain in Javascript

拜拜、爱过 提交于 2019-12-17 23:02:55
问题 I am running into same-origin policy issues in Javascript. I've read about a workaround for this using the document.domain variable, but I cannot get the workaround to work. The workaround is that you are supposed to be able to set document.domain to 'example.com' so that if you run code from foo.example.com it can load data via XHR from bar.example.com . Details on the workaround are here: https://developer.mozilla.org/En/Same_origin_policy_for_JavaScript My example code -- which doesn't

Why Same-origin policy isn't enough to prevent CSRF attacks?

柔情痞子 提交于 2019-12-17 21:46:27
问题 First of all, I assume a backend that control inputs to prevent XSS vulnerabilities. In this answer @Les Hazlewood explain how to protect the JWT in the client side. Assuming 100% TLS for all communication - both during and at all times after login - authenticating with username/password via basic authentication and receiving a JWT in exchange is a valid use case. This is almost exactly how one of OAuth 2's flows ('password grant') works. [...] You just set the Authorization header:

Is there a way to bypass Javascript / jQuery's same origin policy for local access?

半腔热情 提交于 2019-12-17 19:21:54
问题 Trying to use ajax , getJSON , and functions like that to fetch an external URL from a local (non-server) development computer. Is there a way to bypass the same origin policy, so that I can test locally, instead of having to upload to a server? 回答1: Here's the simple answer: chrome --disable-web-security From the source code (chrome_switches.h): // Don't enforce the same-origin policy. (Used by people testing their sites.) const char kDisableWebSecurity[] = "disable-web-security"; I wanted

Why Cross-Domain AJAX call is not allowed?

点点圈 提交于 2019-12-17 19:19:08
问题 Except for JSONP why is same domain policy is being followed? 回答1: The Same Origin Policy has been implemented for security reasons ; quoting a relevant sentence from wikipedia : This mechanism bears a particular significance for modern web applications that extensively depend on HTTP cookies to maintain authenticated user sessions, as servers act based on the HTTP cookie information to reveal sensitive information or take state-changing actions. A strict separation between content provided

How to enable CORS on Firefox?

余生长醉 提交于 2019-12-17 16:17:40
问题 Can somebody please tell me how I allow CORS on firefox? I easily managed it on Chrome and IE, but I am totally failing at it with Firefox. I edited the following about:config entry security.fileuri.strict_origin_policy = false This attempt has been posted several times here and is told on other sites too, but it has no effect. I read the Mozilla guide to Same-origin-policies: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS but it just explains CORS and the related

Get List of jQuery UI themes - from an URL (same-origin-policy)

ぐ巨炮叔叔 提交于 2019-12-17 12:40:02
问题 Does anyone know a way to get list of jQuery themes from http://jquery-ui.googlecode.com/svn/tags/1.8.23/themes/ ? I am creating simple webpage with themes roller where the user can switch themes dynamically. Working fiddle - Click on Themes on Right top corner and select a new theme. Right now the list is hard coded as below, <div id="theme-list"> <ul> <li class="themes-el ui-state-highlight" data-theme="cupertino">cupertino</li> <li class="themes-el" data-theme="hot-sneaks">hot-sneaks</li>

Get List of jQuery UI themes - from an URL (same-origin-policy)

£可爱£侵袭症+ 提交于 2019-12-17 12:39:04
问题 Does anyone know a way to get list of jQuery themes from http://jquery-ui.googlecode.com/svn/tags/1.8.23/themes/ ? I am creating simple webpage with themes roller where the user can switch themes dynamically. Working fiddle - Click on Themes on Right top corner and select a new theme. Right now the list is hard coded as below, <div id="theme-list"> <ul> <li class="themes-el ui-state-highlight" data-theme="cupertino">cupertino</li> <li class="themes-el" data-theme="hot-sneaks">hot-sneaks</li>

Embedding Google Apps Script in an iFrame

浪子不回头ぞ 提交于 2019-12-17 11:05:27
问题 I am trying to embed a page that is dynamically built using Javascript in Google Apps Script into my website in an iFrame, but the iFrame's content isn't shown. Google Apps Script has a same-origin policy which prevents it from loading. What I am trying to do is (I removed the full link): <iframe src="https://script.google.com/a/macros/SCRIPT_ID"></iframe> The error I am getting is: Refused to display 'https://script.google.com/a/macros/SCRIPT_ID' in a frame because it set 'X-Frame-Options'

Embedding Google Apps Script in an iFrame

本秂侑毒 提交于 2019-12-17 11:03:46
问题 I am trying to embed a page that is dynamically built using Javascript in Google Apps Script into my website in an iFrame, but the iFrame's content isn't shown. Google Apps Script has a same-origin policy which prevents it from loading. What I am trying to do is (I removed the full link): <iframe src="https://script.google.com/a/macros/SCRIPT_ID"></iframe> The error I am getting is: Refused to display 'https://script.google.com/a/macros/SCRIPT_ID' in a frame because it set 'X-Frame-Options'

Can Cross-Origin Resource Sharing headers authorize X-Domain IFRAME access?

你。 提交于 2019-12-17 11:03:14
问题 Adjusting the height of an IFRAME to match its content page's height can be a real drag when the containing and content pages are not from the same domain. Do the Cross-Origin Resource Sharing (CORS) headers make it possible for the content page to authorize cross-domain access to its resources and thus allow its containing page to read its height? (or, alternatively, the containing page authorize the content page to announce its height?) Or is CORS strictly an AJAX thing? 回答1: CORS doesn't