angularjs-social-login icon indicating copy to clipboard operation
angularjs-social-login copied to clipboard

FB.login call popup is not allowed

Open Manikandan85 opened this issue 9 years ago • 14 comments

Hi,

I have added the plugin correctly and when I tried to login with facebook, I am getting a console error 'Refused to display 'https://www.facebook.com/v2.7/dialog/oauth...' in a frame because it set 'X-Frame-Options' to 'DENY'.

Please help me to solve this issue.

Manikandan85 avatar Nov 30 '16 12:11 Manikandan85

Hi, are you using this plugin inside an iframe ?? Can you please share your code .

kurapatijayaram avatar Nov 30 '16 18:11 kurapatijayaram

Hi,

I am not using using this plugin inside an iframe. Here is my code

  • Added button in my html page with the directive name <button fb-login type="button">facebook Login</button>
  • Added module in my js and configured the key

var angularApp = angular.module('myApp', ['socialLogin']); angularApp.config(function(socialProvider){ socialProvider.setFbKey({appId: "xxxx", apiVersion: "v2.8"}); });

When I opened my html page and clicked the button, it shows that error message in my console. Please correct me if I am doing anything wrong?

Note: I have not logged into my facebook in the browser.

Manikandan85 avatar Dec 01 '16 04:12 Manikandan85

Did you add any X-Frame-Options ? There is no problem in the code. Look at this - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options FB opens a frame to authenticate. Ensure that your code has not set X-Frame-Options to DENY in header or metatags.

kpsrinivas avatar Dec 01 '16 04:12 kpsrinivas

@kpsrinivas X-Frame options is already disabled in my apache server. On inspecting fb oauth dialog call in Network Tab, in Response header it is set as 'X-Frame-Options to DENY'. I think it is issue with fb. Is there any other way to fix this? header

Manikandan85 avatar Dec 01 '16 05:12 Manikandan85

Are you using this in a "frame" tag ? If yes please move it to outside.

kurapatijayaram avatar Dec 01 '16 05:12 kurapatijayaram

You mean directive in a button? <button fb-login type="button">facebook Login</button>

Manikandan85 avatar Dec 01 '16 05:12 Manikandan85

No. Button inside frame tag.

<frame>
...
<button fb-login type="button">facebook Login</button>
...
</frame>

kurapatijayaram avatar Dec 01 '16 05:12 kurapatijayaram

No. I am not using this inside a frame tag.

Manikandan85 avatar Dec 01 '16 05:12 Manikandan85

Hmmm. But the error is very clear FB will not allow <frame>, <iframe> tags, here error is saying that you are using <frame> tag.

kurapatijayaram avatar Dec 01 '16 05:12 kurapatijayaram

okay. I will further check on this and will post my solution.

Manikandan85 avatar Dec 01 '16 05:12 Manikandan85

Try this. Add X-Frame-Options in your angular header. http://stackoverflow.com/questions/33144580/configuring-x-frame-options

kpsrinivas avatar Dec 01 '16 05:12 kpsrinivas

Hi,

When I tried to use this plugin in a sample angular app, popup is working fine. So I think this issue is with my existing angular app.

One question: I am using "ui-view" in my index html and rendering the templates based on the route. Will that be the cause of my issue?

Manikandan85 avatar Dec 01 '16 11:12 Manikandan85

No. Not at all.

kurapatijayaram avatar Dec 01 '16 11:12 kurapatijayaram

Have you tested in the same browser ?

kurapatijayaram avatar Dec 01 '16 11:12 kurapatijayaram