2014-06-05 2 views
1

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> 

모든 아이디어를 어떻게 해결 하는가?

답변

0

오류 메시지가 실제로에서 발견된다

The frame requesting access has a protocol of "http", the frame being accessed has a protocol of "https". Protocols must match.

그래서 당신은 https를 통해 귀하의 사이트를 제공해야합니다 (SSL, 포트 443). 귀하의 페이지 URL이 https://airus.com (: 443)

관련 문제