Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to call native ios Facebook login dialog from just a web page (not a web app)?

We have an ios app that uses native Facebook login just fine.

Then we also have a website (app is basically an optimized client for it) where people can login via Facebook too. When they open our website in mobile safari, they are directed to Facebook pages to authenticate there and it works, but.. it is still far from native and users have to retype credentials they often have in ios already.

So could it be possible to to somehow launch system fb authentication for just a web page (maybe using some clever URL schema?) and get granted token back to web?

like image 230
Artem Avatar asked Aug 20 '13 17:08

Artem


People also ask

How do I connect IOS to Facebook?

Steps. Tap the Settings app on the device. Scroll and tap the "Facebook" button, which can be found just a little bit below the button labeled Twitter. Tap and enter your Facebook account credentials (username and password) into the login screen's appropriate boxes.

How do I change my callback URL on Facebook app?

In the "Facebook Login" tab under your app, enter all valid callback URL's, such as http://localhost/callback, http://productionUrl/callback, etc. If you don't see "Facebook Login" tab under your app, click "Add Product-> Facebook Login->Get Started" Enter the Valid Callback Urls -> Save changes.

How can I use OAuth on Facebook?

Under Products in the App Dashboard's left side navigation menu, click Facebook Login, then click Settings. Verify the Valid OAuth redirect URIs in the Client OAuth Settings section. state . A string value created by your app to maintain state between the request and callback.


1 Answers

Difficult way As described here http://aaronparecki.com/articles/2012/07/29/1/oauth2-simplified#mobile-apps you could find URL scheme to trigger the native iOS app for app authorization:

fbauth://authorize?redirect_uri=[redirect_uri]&client_id=[client_id]&response_type=token

But if you call that link it's not possible to have a redirection. You could try to hack that redirection but maybe you could not find a way out.

A secure way to solve that problem is to use a SSO token to authenticate user on your App when he logs in, and next on Safari take a redirection, with a custom url to your APP, that do as bridge to FB App via Token stored in your APP. After FB authentication you can directly redirect user back to your landing page in Safari. As said by @Lego it's an alternative way to direct authenticate that could be made by going deep to custom URL used by FB.

like image 199
Nanako Kyobashi Avatar answered Oct 07 '22 01:10

Nanako Kyobashi