Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook login button redirect to blank page on MS Edge

This issue is no longer a problem for me. Facebook doesn't allow you to share/post photos on the web anymore. As for the login issue, i cannot tell which solution proposed resovles the issue since I am no longer working on it. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

I am working on a login button for sharing purposes. The button and sharing feature works great on every browser except MS Edge. It used to work on Edge 25 (I'm currently on Edge 38).

The problem is that when I click on the login button, a login popup appears in which I can enter my credentials. Once they are entered and I try to login, the popup doesn't close and is redirected to this address:

https://www.facebook.com/v2.1/dialog/oauth?app_id=141515299765971&auth_type=&channel_url=http%3A%2F%2Fstaticxx.facebook.com%2Fconnect%2Fxd_arbiter%2Fr%2FlY4eZXm_YWu.js%3Fversion%3D42%23cb%3Df2de29c1e9204f4%26domain%3Dikeabuilds.sandbox3.2020.net%26origin%3Dhttp%253A%252F%252Fikeabuilds.sandbox3.2020.net%252Ff1deb23126bcc0c%26relation%3Dopener&client_id=141515299765971&display=popup&domain=ikeabuilds.sandbox3.2020.net&e2e=%7B%7D&locale=en_US&logger_id=80452c59-88a0-7681-0f2c-ac690c1d62b8&origin=1&redirect_uri=http%3A%2F%2Fstaticxx.facebook.com%2Fconnect%2Fxd_arbiter%2Fr%2FlY4eZXm_YWu.js%3Fversion%3D42%23cb%3Df1aa391653df35c%26domain%3Dikeabuilds.sandbox3.2020.net%26origin%3Dhttp%253A%252F%252Fikeabuilds.sandbox3.2020.net%252Ff1deb23126bcc0c%26relation%3Dopener%26frame%3Df7b23e2a9aa328&ref=LoginButton&response_type=none%2Ctoken%2Csigned_request&scope=publish_actions&sdk=joey&seen_revocable_perms_nux=false&version=v2.1

I am not considered logged in too. I searched a lot on the web and even read the documentation about the login button and haven't found anything except that there is only one workaround. It consist of adding the facebook url to the trusted site in the internet options of windows. It is not a viable solution and therefore is not a solution for me. The images are the code of the facebook login html page, the blank redirect page and the one containing the login button. I also have a .js page containing all facebook related functions but doesn't fit in one image, if need be I will provide it. What is going on?

The facebook login button:

The redirect link:

The html code for the page containing the facebook login button:

like image 419
NativeSeb Avatar asked Nov 09 '17 22:11

NativeSeb


1 Answers

From what I have tested, I am able to reproduce your issue, but I am not sure if this is the case in your situation.

The same issue happens when MS Edge or IE blocks pop-ups and the user chooses to "Allow once" the popup and when the popup tries to redirect, you get the blank page(it is blocked).

If you choose to "Allow always", the popup redirects and closes correctly.

What you can do to overcome this, is actually enable

  • login redirect,
  • let the redirect place a cookie at your domain
  • use Facebook JS SDK and check if the user is connected.

So, first enable the login redirect:

enter image description here

and then do:

FB.init({
  appId            : 'APP_ID',
  autoLogAppEvents : true,
  cookie           : true,  // <-- use this
  xfbml            : true,
  version          : 'v3.0'
});
var uri = encodeURI('http://test.gr');
FB.getLoginStatus(function(response) {
    if (response.status === 'connected') {
        console.log(response.status); // should log connected.

    } else {
       window.location = 'https://www.facebook.com/v3.0/dialog/oauth?client_id=APP_ID&redirect_uri='+encodeURI(uri)+'&display=popup&scope=user_status&response_type=token&version=v3.0';
    }
});

Replace "test.gr" and "APP_ID" with your domain and app id.

After the redirect back to your site, a cookie with name fbm_{APP_ID} will be placed for your domain, which enables user to be logged in.

References

  • Facebook login without popup
like image 144
Jannes Botis Avatar answered Sep 27 '22 19:09

Jannes Botis