I'm implementing external OAuth authentication at my webiste. On button click I'm opening popup with let's facebook auth page. Now I need to know when authentication is completed to read an OAuth token and close the popup.
click: function () {
var popup = window.open(url, title, '<options>');
popup.onload = function () {
//1. if url contains token - finish OAuth authentication
//2. close popup
//but 'onload' doesn't work for external domains
}
return false;
},
When I'm trying to access using polling technique I'm hetting the following security error:
Uncaught SecurityError: Blocked a frame with origin "https://some_app_host_not_the_same_as_following.com" from accessing a frame with origin "https://some_auth_host_which_works_with_facebook.com". Protocols, domains, and ports must match.
How can I achieve this?