oauth 팝업을 통해 foursquare.com에서 볼 수있는 것과 동일한 웹 응용 프로그램을 통해 Google Plus 로그인을 구축하려고합니다. 응용 프로그램이 콘솔에 다음 오류를 표시합니다.Cross Origin 창 제어
Uncaught SecurityError: Blocked a frame with origin " http://airus.com:3000 " from accessing a frame with origin " https://accounts.google.com ". The frame requesting access has a protocol of "http", the frame being accessed has a protocol of "https". Protocols must match.
<script type="text/javascript">
var REDIRECT = 'http://airus.com/users/auth/google_oauth2/callback';
function login(url, x) {
var win = window.open(url, "windowname1", 'width=400, height=600');
var pollTimer = window.setInterval(function() {
console.log(win.document.URL);
if (win.document.URL.indexOf(REDIRECT) != -1) {
window.clearInterval(pollTimer);
var url = win.document.URL;
win.close();
x.reload();
}
}, 500);
}
$("#link").click(function(){
x = location;
login($(this).attr('href'), x);
return false;
})
</script>
모든 아이디어를 어떻게 해결 하는가?