Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook login doesn't work in HK but works for me

I have a Meteor app which lets users register through facebook oauth through meteor's accounts-facebook package. I have set-up all the neccesary packages and UI, and deployed the app on Heroku (free plan) with an mLab database (sandbox). I have set up facebook app and authentication, and the login works fine for me. I have registered on the app through my facebook multiple times successfully.

However when one of my fellow developers who lives in Hong Kong (I am in India) tried to do the same, the app wouldn't register him, and the popup browser printed this error in the console after he gave permission to access his public profile -

DOMException: Blocked a frame with origin "https://myapp.herokuapp.com" from accessing cross-origin frame.

This error seemed to be coming from end_of_popup_response.js:18 in the oauth package.

Is there any particular fixable reason to this error?

like image 926
Dev Agrawal Avatar asked Jun 27 '18 10:06

Dev Agrawal


1 Answers

there is a policy in JavaScript named Same-origin. and by that policy if you want to access a frame, Protocol, Hostname and Port must be the same of your domain.

read this for some examples: SecurityError: Blocked a frame with origin from accessing a cross-origin frame

like image 85
Majid Roustaei Avatar answered Oct 20 '22 22:10

Majid Roustaei