How to enable cross app authentication for iOS apps? - ios

Is there a method for cross app authentication in iOS that allows a user who has an authenticated session with one app to get authenticated for another app from the same developer? It works pretty nicely for the Facebook app and Facebook messenger on iOS, but I couldn't find any documentation on it.

Related

Apple approval for app with GPPSignIn

Is it possible to use GPPSignIn and be approved by the app store?
Apple doesn't approve apps with login processes that redirect users outside of the app.
GPPSignIn redirects users outside of the app during login.
It provides single sign-on via the Google+ app (if installed), Chrome
for iOS (if installed), or Mobile Safari.
What gives? Is Google pushing an iOS API that cannot be used for an approved iOS app?
You should update to GIDSignIn. It allows you to choose whether you want to sign in via another app or via web view.
https://developers.google.com/identity/sign-in/ios/

How to implement facebook cross-apps authorization for iOS

I'm developing mobile app for iOS 8 with Firemonkey (just for info) and my app works with Facebook. I did Facebook authorization though browser by specifying email and password. Everything works fine, but now I'd like to auto login to my custom iOS app without specifying email and password, if I already logged in to the native Facebook app.
For example, we have two iOS 8 apps: 1) native Facebook app and 2) my custom app. All apps are logged out of Facebook. I login to native Facebook app, then open my custom app. How can my custom app retrieve access token from native Facebook app for auto login?
I will be grateful for any code example in any programming language.

Facebook iOS Auth without app switching

Our iOS app currently uses basic Facebook authentication to get user profile info. When the user taps on authenticate, the app does a fast switch between the Facebook App and our app to authenticate.
We would like to avoid the fast switch and remain in our app while we authenticate the user with FB. We noticed that this was done nicely on the Beats Music app for iOS.
Thanks in advance,
AppsXpress

How does Facebook SSO know which app to return to?

Using Facebook SSO (Single Sign on), after the system prompts the user for permissions to work with their Facebook account, it directs the user back to the app that SSO was being run in. How specifically does FB SSO accomplish this? (How does it know which app to reopen after the permissions are granted?)
We are building a SDK that interacts with Facebook, and it is not clear how the facebook app figures out which app to return to.
When you add the Facebook SDK, one of the steps is to register a URL scheme for your app with your API key.
When you authorize the app in Facebook it tries to open the URL (usually formatted like fbXXXXXXXXXXX) and since your app is set to handle this URL scheme so the app is opened.
And here's a list of other apps you can communicate using handleOpenURL:
http://handleopenurl.com/

How does Facebook Messenger iPhone app gets login information from Facebook iPhone app?

If you have both Facebook iPhone app and Facebook messenger app installed in your iPhone, I noticed that, as long as you are logged in in the Facebook app, Facebook messenger app knows who you are immediately!
How did facebook do that?
How do two applications talk to each other?
I am interested to know this because I want to know if it is possible for two applications to share some common data (e.g. products database) so that those data only has to be updated in one app.
A suite of iOS applications can use Keychain Access sharing to share credential information. You cannot, however, share a database on the device. You would need to either create one monolithic app, or store the shared data off-device.
I'm gonna take a guess but I think they storage your UDID in their DBs with the current logged user
Basically this is done using Single Sign-On (SSO) feature of the Facebook iOS SDK. According to the facebook developer documentation, https://developers.facebook.com/docs/mobile/ios/build/#implementsso,
it states that if the user already has the Facebook app of version greater than 3.2.3 installed and that the iOS device of the user supports multitasking, then basically the app (the facebook messenger in this case) can ask for the current logged in user information from the main Facebook program.
"One of the most compelling features of the iOS SDK is Single-Sign-On (SSO). SSO lets users sign into your app using their Facebook identity. If they are already signed into the Facebook iOS app on their device they do not have to even type a username and password. Further, because they are signing to your app with their Facebook identity, you can get permission from the user to access to their profile information and social graph"
"If the app is running in a version of iOS that supports multitasking, and if the device has the Facebook app of version 3.2.3 or greater installed, the SDK attempts to open the authorization dialog within the Facebook app. After the user grants or declines the authorization, the Facebook app redirects back to the calling app, passing the authorization token, expiration, and any other parameters the Facebook OAuth server may return."

Resources