How does automatic login happen using FB - facebook

I wanted to understand, after clicking on Login with FB. How does FB determine the logged in accounts in device? In other words, I wanted to understand the "Continue as" screen come up.
I tried understanding the code flow in android fb sdk. But after "performLogin", couldnt understand how popup is displayed.

Related

Third party authentication doesn't work from facebook browser

I have a web application (React js with Kotlin backend) that has normal email + pw (plus PIN) login, and it also supports 3rd party authentication (Google and Facebook). It works on mobile and web, however, when I open my webpage through Facebook app - which opens it's own browser - and try to log in with 3rd party authentication, I can click on that "Continue as me" button, but then the page refreshes and I'm not logged in. I saw the same thing happen on other sites too, e.g. Figma, Pinterest, etc. I thought it's impossible to log in this way anymore, however, I just noticed that you can actually log in to Stackoverflow this way (so facebook app -> facebook browser -> stack overflow -> 3rd party auth and it works).
Has anyone figured it out how it was possible for Stackoverflow to do this?
Ok, I found the solution. The problem was that when a user clicked on 'Login with FB' button on my site, I sent a request to fb to get back a content of a login window and I created a pop up window where I rendered it, I put on a listener on that pop up window and once it was done, then I got the access token and sent it to backend and logged the user in. On a normal browser it works perfect (both pc and mobile) but as I mentioned above it didn't work in an in app browser like facebook app.
The issue was that facebook app opens a website in it's own browser that doesn't handle any pop ups, so after a successful authentication I saw that nothing happened and it was because we were not redirected to the original window where we should have, and it had the token in the url. So the solution was instead of making this pop up window for FB login, just redirect the user to the fb login page (and stay on the same window), and once the login is successful, just handle the token as is.

Facebook sdk4 php switch User feature

I am developing a site to manage Facebook Feeds and is using facebook-php-sdk-v4-4.0-dev.I have the user Login and access token saved to database functionality working properly.
I need to show Switch Facebook User account Option, If he is already logged into facebook account. Currently if he is logged into facebook account on another tab. There will not be facebook authentication, It just shows App Permissions window and then completes facebook login process.
But I found that this option is available in Facebook Login for the Web with the JavaScript SDK example...A pop up come up for Login and you can switch user on top right side.
Please let me know how to accomplish this in PHP sdk 4 or work around, or am I missing something here.
Thanks in advance....
Please see this screenshot
https://fbcdn-dragon-a.akamaihd.net/hphotos-ak-xpf1/t39.2178-6/10574702_711575178930859_1600770327_n.png
I have added a screenshot where JavaScript SDK show switch user button (top right side)when user is logged in to facebook account in another browser tab.(this comes up as pop up)
But there is no such option when using php sdk. instead of pop up, its come as a webpage and it does not have switch user account.

Facebook app submission keeps getting rejected

I have made website where people can logon to with Facebook.
Ik keep getting this message every time I submit my request.
Your app's Facebook Login button does not work. Please make sure the
provided test user can successfully and consistently log in with the
Facebook Login button. See more about authentication.
Even though my created test user can login with IE, FF and Chrome.
Can anybody help me?
I am getting the same thing. I think you need to put the facebook javascript code in your website for them to see. I think that it is a bot reviewing your app, not a person, and it does not see it.

Proper Facebook login for website

I want to allow people to log onto our website using their Facebook account. I noticed that when I click the login we added, the window opens displaying a detailed message and has a button which says Play Game.
On other sites I've seen a pretty simple window such as on CNet with a Cancel and Okay button on the bottom.
Did I setup something incorrectly on Facebook that is causing mine to be more complex?

Is there a way to disable the "Please log in to continue" message in a Facebook Canvas app?

when you visit a Facebook Canvas app (such as http://apps.facebook.com/branchout/) and you are not logged in to Facebook, you will get the "Please log in to continue." dialog every 10 seconds or so.
I am planning to develop a Facebook Canvas app that does not ask for user authentication/ app authorization upfront (I don't want to scare users away), but I do not want to go that way if I cannot stop that dialog.
Is there any way to disable it, or should I rather ask for authentication/ authorization upfront? Thank you for sharing your experience.
Brent is right, it's just a bug. The what's-going-on pane on the right hand side tries to reload, and gets confused when there's no user logged in. Don't worry about it, it should be gone soon :-)
I'm pretty sure that is Facebook trying to refresh their ads. I've done a few apps that don't require authentication or login until specific actions are performed. If you are not logged into Facebook, then that prompt comes up. The only action I am performing is calling getLoginStatus on load. Unfortunately, it doesn't seem like there is any way around it. When I load my app directly (not in a Facebook iframe), the prompt doesn't come up.