Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Native Facebook Login experience via browser

I have seen several flavours of this question going around but nothing exactly specific nor answered so trying it myself.

I am trying to build a Facebook login experience via the browser into my Facebook-based app that will require the users to not remember their passwords as much as possible. This means that if

  • they log in via their desktop browser and are already logged in, it will only ask them to 'OK' the permissions
  • they log in from their mobile browser and are logged in via their respective native app (Android/iOS), it will simply redirect them to the native app, ask for the app permissions and redirect them back to the success page on the browser
  • they log in from any browser and are not currently logged onto Facebook in any form, they have to enter their password and authenticate (whether natively or via browser this does not matter)

I know how the first can be done - that is pretty straightforward using the JS SDK. The second point is the tougher bit.

I am aware of existing custom URL schemes for Android and iOS but nothing specifically really mentions how that can be used for authentication and/or authorisation of Facebook apps. Does anyone have any ideas on how this can be done?

Thanks!

like image 903
SalGad Avatar asked Jan 06 '14 05:01

SalGad


People also ask

Can you log into Facebook on browser but not app?

Check For Updates (Android and iOS). If you cannot access your account on the app but can log in on Facebook's website, then try to update your Facebook app. Possibly, the version of Facebook installed on your device is no longer supported, or it contains a bug or glitch related to logging in.

How do I enable Facebook Login from embedded browser?

To resolve the issue of 'Logging into Facebook from an embedded browser is disabled', visit the Facebook account settings page to enable the 'Links open externally' option. This ensures that whenever you try to open Facebook through a game or an app that uses an embedded browser, the error message would not pop up.

How do I connect to Facebook on my browser?

Go to m.facebook.com on your mobile browser. Enter one of the following: Email: You can log in with any email that's listed on your Facebook account. Phone number: If you have a mobile number confirmed on your account, you can enter it here (don't add any zeros before the country code, or any symbols).

Does Facebook Login use OAuth?

Web OAuth Login settings enables any OAuth client token flows that use the Facebook web login dialog to return tokens to your own website.


3 Answers

In iOS use iOS facebook SDK. It will handle the login process effectively in different situations depending on the resources available. Check out this answer to know about different login flows

Integrating facebook

like image 101
Anil Varghese Avatar answered Nov 02 '22 08:11

Anil Varghese


You're looking for Single Sign On behavior- in Facebook, use the native SDK, and instructions for setting up SSO. It includes entering your bundle id in the settings and setting up a referring url name (the name of your app usually). So what happens is- if you launch safari mobile, and log into facebook. Then, launch your app, with good integrated SSO. Then, it won't require you to login/pass, because it knows you've authenticated via browser. Same with Android.

like image 39
Anna Billstrom Avatar answered Nov 02 '22 09:11

Anna Billstrom


I think what you are looking for (at least for Android) is starting an Intent on certain schema that will open Facebook app.

This is answered here Android facebook intent to show profile with class com.facebook.katana.ProfileTabHostActivity doesn't work any more

like image 38
Igor Čordaš Avatar answered Nov 02 '22 07:11

Igor Čordaš